Back to models
Classifier

CanonicalIntervalForest

Canonical Interval Forest Classifier (CIF).

Quickstart

python
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)

Parameters(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 None set 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 sktime ContinuousIntervalTree, an implementation of the original tree used with embedded attribute processing for faster predictions.

  • "DTC" uses the sklearn DecisionTreeClassifier(criterion="entropy").

n_jobsint, default=1

The number of jobs to run in parallel for both fit and predict. -1 means using all processors.

random_stateint or None, default=None
Seed for random number generation.

Examples

>>> 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)

References

  1. [1 ] 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