Zurück zu den Modellen
Classifier

TimeSeriesForestClassifier

Predict probaFeature importance

Time series forest classifier.

A time series forest is an ensemble of decision trees built on random intervals. Overview: Input n series length m. For each tree

  • sample sqrt(m) intervals,

  • find mean, std and slope for each interval, concatenate to form new

data set, if inner series length is set, then intervals are sampled within bins of length inner_series_length. - build decision tree on new data set.

Ensemble the trees with averaged probability estimates.

This implementation deviates from the original in minor ways. It samples intervals with replacement and does not use the splitting criteria tiny refinement described in [1].

This classifier is intentionally written with low configurability, for performance reasons.

  • for a more configurable tree based ensemble, use sktime.classification.ensemble.ComposableTimeSeriesForestClassifier, which also allows switching the base estimator.

  • to build a a time series forest with configurable ensembling, base estimator, and/or feature extraction, fully from composable blocks, combine sktime.classification.ensemble.BaggingClassifier with any classifier pipeline, e.g., pipelining any sklearn classifier with any time series feature extraction, e.g., Summarizer

Schnellstart

python
from sktime.classification.interval_based import TimeSeriesForestClassifier

estimator = TimeSeriesForestClassifier(min_interval=3, n_estimators=200, inner_series_length: int | None=None, n_jobs=1, random_state=None)

Parameter(5)

n_estimatorsint, default=200
Number of estimators to build for the ensemble.
min_intervalint, default=3
Minimum length of an interval.
n_jobsint, default=1

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

inner_series_length: int, default=None
The maximum length of unique segments within X from which we extract intervals is determined. This helps prevent the extraction of intervals that span across distinct inner series.
random_stateint or None, default=None
Seed for random number generation.

Beispiele

>>> from sktime.classification.interval_based import TimeSeriesForestClassifier
>>> 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 = TimeSeriesForestClassifier (n_estimators = 5)
>>> clf. fit (X_train, y_train) TimeSeriesForestClassifier(n_estimators=5)
>>> y_pred = clf. predict (X_test)

Referenzen

[1]

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