paddlets.models.representation.task.repr_classifier

class ReprClassifier(repr_model: ReprBaseModel, repr_model_params: Optional[dict] = None, encode_params: Optional[dict] = None, downstream_learner: Optional[Callable] = None, verbose: bool = False)[source]

Bases: StackingEnsembleBase

The ReprClassifier Class.

Parameters
  • repr_model (ReprBasemodel) – Representation model to use for forcast.

  • repr_model_params (dict) – params for reprmodel init.

  • encode_params (dict) – params for reprmodel encode, “slide_len” will set to in_chunk_len by force.

  • downstream_learner (Callable) – The downstream learner, should be a sklearn-like classifier, set to GradientBoostingClassifier() by default.

  • verbose (bool) – Turn on Verbose mode,set to true by default.

fit(train_tsdatasets: List[TSDataset], train_labels: ndarray) None[source]
Parameters
  • train_tsdatasets (TSDataset) – train data.

  • train_labels – labels, length equal to length of tsdataset_list

predict(tsdatasets: List[TSDataset]) ndarray[source]

Predict

Parameters

tsdataset_list (TSDataset) – predict data.

predict_proba(tsdatasets: List[TSDataset]) ndarray[source]

Predict proba

Parameters

tsdataset_list (TSDataset) – predict data.

save(path: str, repr_classifier_file_name: str = 'repr-classifier-partial.pkl') None[source]

Save the repr-classifier model to a directory.

Parameters
  • path (str) – Output directory path.

  • ensemble_file_name (str) – Name of repr-classifier model object. This file contains meta information of repr-cluster model.

static load(path: str, repr_classifier_file_name: str = 'repr-classifier-partial.pkl') ReprClassifier[source]

Load the repr-classifier model from a directory.

Parameters
  • path (str) – Input directory path.

  • ensemble_file_name (str) – Name of repr-classifier model object. This file contains meta information of repr-cluster model.

Returns

The loaded ensemble model.