CanonicalIntervalForest
Canonical Interval Forest Classifier (CIF).
Implementation of the interval based forest making use of the catch22 feature set on randomly selected intervals described in Middlehurst et al. (2020). [1]
Overview: Input “n” series with “d” dimensions of length “m”. For each tree:
Sample n_intervals intervals of random position and length
Subsample att_subsample_size catch22 or summary statistic attributes randomly
Randomly select dimension for each interval
Calculate attributes for each interval, concatenate to form new data set
Build decision tree on new data set
ensemble the trees with averaged probability estimates
Schnellstart
from sktime.classification.interval_based import CanonicalIntervalForest
estimator = CanonicalIntervalForest(n_estimators=200, n_intervals=None, att_subsample_size=8, min_interval=3, max_interval=None, base_estimator='CIT', n_jobs=1, random_state=None)Parameter(8)
- n_estimatorsint, default=200
- Number of estimators to build for the ensemble.
- n_intervalsint or None, default=None
Number of intervals to extract per tree, if None extracts
(sqrt(series_length) * sqrt(n_dims))intervals.- att_subsample_sizeint, default=8
- Number of catch22 or summary statistic attributes to subsample per tree.
- min_intervalint, default=3
- Minimum length of an interval.
- max_intervalint or None, default=None
Maximum length of an interval, if
Noneset to(series_length / 2).- base_estimatorsklearn classifier or str, default=”CIT”.
Base estimator for the ensemble, can be supplied a sklearn BaseEstimator or a string for predefined classifiers. Possible strings:
"CIT", uses the sktimeContinuousIntervalTree, an implementation of the original tree used with embedded attribute processing for faster predictions."DTC"uses the sklearnDecisionTreeClassifier(criterion="entropy").
- n_jobsint, default=1
The number of jobs to run in parallel for both
fitandpredict.-1means using all processors.- random_stateint or None, default=None
- Seed for random number generation.
Beispiele
>>> from sktime.classification.interval_based import CanonicalIntervalForest
>>> 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 = CanonicalIntervalForest (
... n_estimators = 3, n_intervals = 2, att_subsample_size = 2
... )
>>> clf. fit (X_train, y_train) CanonicalIntervalForest(
... )
>>> y_pred = clf. predict (X_test)Referenzen
Matthew Middlehurst and James Large and Anthony Bagnall. “The Canonical Interval Forest (CIF) Classifier for Time Series Classification.” IEEE International Conference on Big Data 2020