Classifier
TemporalDictionaryEnsemble
Temporal Dictionary Ensemble (TDE).
Quickstart
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)Parameters(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
fitandpredict.-1means using all processors.- random_stateint or None, default=None
- Seed for random number generation.
Examples
>>> 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)References
- [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.