Skip to content

ContinuousIntervalTree

ContinuousIntervalTree

class ContinuousIntervalTree(max_depth=9223372036854775807, thresholds=20, random_state=None)[source]

Continuous interval tree (CIT) vector classifier (aka Time Series Tree).

The Time Series Tree described in the Time Series Forest (TSF) paper Deng et al (2013) [1]. A simple information gain based tree for continuous attributes using a bespoke margin gain metric for tie breaking.

Implemented as a bade classifier for interval based time series classifiers such as CanonicalIntervalForest and DrCIF.

Parameters:
max_depthint, default=sys.maxsize

Maximum depth for the tree.

thresholdsint, default=20

Number of thresholds to split continuous attributes on at tree nodes.

random_stateint, RandomState instance or None, default=None

If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

Attributes:
classes_list

The unique class labels in the training set.

n_classes_int

The number of unique classes in the training set.

n_instances_int

The number of train cases in the training set.

n_atts_int

The number of attributes in the training set.

See also

CanonicalIntervalForest
DrCIF

Notes

For the Java version, see tsml.

References

[1]

H.Deng, G.Runger, E.Tuv and M.Vladimir, “A time series forest for classification and feature extraction”,Information Sciences, 239, 2013

Examples

>>> from sktime.classification.sklearn import ContinuousIntervalTree
>>> from sktime.datasets import load_unit_test
>>> from sktime.datatypes._panel._convert import from_nested_to_3d_numpy
>>> 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)
>>> X_train = from_nested_to_3d_numpy(X_train)
>>> X_test = from_nested_to_3d_numpy(X_test)
>>> clf = ContinuousIntervalTree()
>>> clf.fit(X_train, y_train)
ContinuousIntervalTree(...)
>>> y_pred = clf.predict(X_test)

Methods

fit(X, y)

Fit a tree on cases (X,y), where y is the target variable.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

predict(X)

Predict for all cases in X.

predict_proba(X)

Probability estimates for each class for all cases in X.

set_params(**params)

Set the parameters of this estimator.

tree_node_splits_and_gain()

Recursively find the split and information gain for each tree node.