Classifier
TSFreshClassifier
Time Series Feature Extraction based on Scalable Hypothesis Tests classifier.
Quickstart
python
from sktime.classification.feature_based import TSFreshClassifier
estimator = TSFreshClassifier(default_fc_parameters='efficient', relevant_feature_extractor=True, estimator=None, verbose=0, n_jobs=1, chunksize=None, random_state=None)Parameters(7)
- default_fc_parametersstr, default=”efficient”
- Set of TSFresh features to be extracted, options are “minimal”, “efficient” or “comprehensive”.
- relevant_feature_extractorbool, default=False
- Remove irrelevant features using the FRESH algorithm.
- estimatorsklearn classifier, default=None
- An sklearn estimator to be built using the transformed data. Defaults to a Random Forest with 200 trees.
- verboseint, default=0
- level of output printed to the console (for information only)
- n_jobsint, default=1
The number of jobs to run in parallel for both
fitandpredict.-1means using all processors.- chunksizeint or None, default=None
- Number of series processed in each parallel TSFresh job, should be optimised for efficient parallelisation.
- random_stateint or None, default=None
- Seed for random, integer.
Examples
>>> from sktime.classification.feature_based import TSFreshClassifier
>>> from sklearn.ensemble import RandomForestClassifier
>>> from sktime.datasets import load_unit_test
>>> X_train, y_train = load_unit_test (split = "train", return_X_y = True)
>>> X_test, y_test = load_unit_test (split = "test", return_X_y = True)
>>> clf = TSFreshClassifier (
... estimator = RandomForestClassifier (n_estimators = 5),
... default_fc_parameters = "efficient",
... )
>>> clf. fit (X_train, y_train) TSFreshClassifier(
... )
>>> y_pred = clf. predict (X_test)References
- [1 ] Christ, Maximilian, et al. “Time series feature extraction on basis of scalable hypothesis tests (tsfresh-a python package).” Neurocomputing 307 (2018): 72-77. https://www.sciencedirect.com/science/article/pii/S0925231218304843