Classifier
DrCIF
Diverse Representation Canonical Interval Forest Classifier (DrCIF).
Quickstart
python
from sktime.classification.interval_based import DrCIF
estimator = DrCIF(n_estimators=200, n_intervals=None, att_subsample_size=10, min_interval=4, max_interval=None, base_estimator='CIT', time_limit_in_minutes=0.0, contract_max_n_estimators=500, save_transformed_data=False, n_jobs=1, random_state=None)Parameters(11)
- n_estimatorsint, default=200
- Number of estimators to build for the ensemble.
- n_intervalsint, length 3 list of int or None, default=None
- Number of intervals to extract per representation per tree as an int for all representations or list for individual settings, if None extracts (4 + (sqrt(representation_length) * sqrt(n_dims)) / 3) intervals.
- att_subsample_sizeint, default=10
- Number of catch22 or summary statistic attributes to subsample per tree.
- min_intervalint or length 3 list of int, default=4
- Minimum length of an interval per representation as an int for all representations or list for individual settings.
- max_intervalint, length 3 list of int or None, default=None
- Maximum length of an interval per representation as an int for all representations or list for individual settings, if None set to (representation_length / 2).
- base_estimatorBaseEstimator or str, default=”CIT”
- Base estimator for the ensemble, can be supplied a sklearn BaseEstimator or a string for suggested options. “DTC” uses the sklearn DecisionTreeClassifier using entropy as a splitting measure (sklearn.tree.DecisionTreeClassifier). “CIT” uses the sktime ContinuousIntervalTree, an implementation of the original tree used with embedded attribute processing for faster predictions (sktime.classification.interval_based.ContinuousIntervalTree). In order to pass parameters to estimators, pass a BaseEstimator instance.
- time_limit_in_minutesint, default=0
- Time contract to limit build time in minutes, overriding n_estimators. Default of 0 means n_estimators is used.
- contract_max_n_estimatorsint, default=500
- Max number of estimators when time_limit_in_minutes is set.
- save_transformed_databool, default=False
- Save the data transformed in fit for use in _get_train_probs.
- 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.
Examples
>>> from sktime.classification.interval_based import DrCIF
>>> 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 = DrCIF (
... n_estimators = 3, n_intervals = 2, att_subsample_size = 2
... )
>>> clf. fit (X_train, y_train) DrCIF(
... )
>>> y_pred = clf. predict (X_test)References
- [1 ] Middlehurst, Matthew, James Large, Michael Flynn, Jason Lines, Aaron Bostrom, and Anthony Bagnall. “HIVE-COTE 2.0: a new meta ensemble for time series classification.” arXiv preprint arXiv:2104.07551 (2021).