Zurück zu den Modellen
Classifier

TemporalDictionaryEnsemble

MultivariatePredict probaTrain estimateContractable

Temporal Dictionary Ensemble (TDE).

Implementation of the dictionary based Temporal Dictionary Ensemble as described in [R822586daffca-1].

Overview: Input “n” series length “m” with “d” dimensions TDE searches “k” parameter values selected using a Gaussian processes regressor, evaluating each with a LOOCV. It then retains “s” ensemble members. There are six primary parameters for individual classifiers:

  • alpha: alphabet size

  • w: window length

  • l: word length

  • p: normalise/no normalise

  • h: levels

  • b: MCB/IGB

For any combination, an individual TDE classifier slides a window of length w along the series. The w length window is shortened to an l length word through taking a Fourier transform and keeping the first l/2 complex coefficients. These lcoefficients are then discretised into alpha possible values, to form a word length l using breakpoints found using b. A histogram of words for each series is formed and stored, using a spatial pyramid of h levels. For multivariate series, accuracy from a reduced histogram is used to select dimensions.

fit involves finding n histograms. predict uses 1 nearest neighbour with a the histogram intersection distance function.

Schnellstart

python
from sktime.classification.dictionary_based import TemporalDictionaryEnsemble

estimator = TemporalDictionaryEnsemble(n_parameter_samples=250, max_ensemble_size=50, max_win_len_prop=1, min_window=10, randomly_selected_params=50, bigrams=None, dim_threshold=0.85, max_dims=20, time_limit_in_minutes=0.0, contract_max_n_parameter_samples=inf, typed_dict=True, save_train_predictions=False, n_jobs=1, random_state=None)

Parameter(14)

n_parameter_samplesint, default=250
Number of parameter combinations to consider for the final ensemble.
max_ensemble_sizeint, default=50
Maximum number of estimators in the ensemble.
max_win_len_propfloat, default=1
Maximum window length as a proportion of series length, must be between 0 and 1.
min_windowint, default=10
Minimum window length.
randomly_selected_params: int, default=50
Number of parameters randomly selected before the Gaussian process parameter selection is used.
bigramsboolean or None, default=None
Whether to use bigrams, defaults to true for univariate data and false for multivariate data.
dim_thresholdfloat, default=0.85
Dimension accuracy threshold for multivariate data, must be between 0 and 1.
max_dimsint, default=20
Max number of dimensions per classifier for multivariate data.
time_limit_in_minutesint, default=0
Time contract to limit build time in minutes, overriding n_parameter_samples. Default of 0 means n_parameter_samples is used.
contract_max_n_parameter_samplesint, default=np.inf
Max number of parameter combinations to consider when time_limit_in_minutes is set.
typed_dictbool, default=True
Use a numba typed Dict to store word counts. May increase memory usage, but will be faster for larger datasets. As the Dict cannot be pickled currently, there will be some overhead converting it to a python dict with multiple threads and pickling.
save_train_predictionsbool, default=False
Save the ensemble member train predictions in fit for use in _get_train_probs leave-one-out cross-validation.
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.

Beispiele

>>> from sktime.classification.dictionary_based import TemporalDictionaryEnsemble
>>> 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 = TemporalDictionaryEnsemble (
... n_parameter_samples = 10,
... max_ensemble_size = 3,
... randomly_selected_params = 5,
... )
>>> clf. fit (X_train, y_train) TemporalDictionaryEnsemble(
... )
>>> y_pred = clf. predict (X_test)

Referenzen

[1]

Matthew Middlehurst, James Large, Gavin Cawley and Anthony Bagnall “The Temporal Dictionary Ensemble (TDE) Classifier for Time Series Classification”, in proceedings of the European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2020.