IndividualTDESKTimeWrapper
Python template · sinapsis_sktime.templates.sktime_classifiers
Overview
Template for SkTime classification model training and inference for the dictionary_based module.
IndividualTDE — inherited documentation
Single TDE classifier, an extension of the Bag of SFA Symbols (BOSS) model.
Base classifier for the TDE classifier. Implementation of single TDE base model from Middlehurst (2021). [1]_
Overview: input "n" series of length "m" and IndividualTDE performs a SFA transform to form a sparse dictionary of discretised words. The resulting dictionary is used with the histogram intersection distance function in a 1-nearest neighbor.
fit involves finding "n" histograms.
predict uses 1 nearest neighbor with the histogram intersection distance function.
Parameters ---------- window_size : int, default=10 Size of the window to use in the SFA transform. word_length : int, default=8 Length of word to use to use in the SFA transform. norm : bool, default=False Whether to normalize SFA words by dropping the first Fourier coefficient. levels : int, default=1 The number of spatial pyramid levels for the SFA transform. igb : bool, default=False Whether to use Information Gain Binning (IGB) or Multiple Coefficient Binning (MCB) for the SFA transform. alphabet_size : default=4 Number of possible letters (values) for each word. bigrams : bool, default=False Whether to record word bigrams in the SFA transform. dim_threshold : float, default=0.85 Accuracy threshold as a proportion of the highest accuracy dimension for words extracted from each dimensions. Only applicable for multivariate data. max_dims : int, default=20 Maximum number of dimensions words are extracted from. Only applicable for multivariate data. typed_dict : bool, default=True Use a numba TypedDict to store word counts. May increase memory usage, but will be faster for larger datasets. n_jobs : int, default=1 The number of jobs to run in parallel for both ``fit`` and ``predict``. ``-1`` means using all processors. random_state : int or None, default=None Seed for random, integer.
Attributes ---------- n_classes_ : int The number of classes. classes_ : list The classes labels. n_instances_ : int The number of train cases. n_dims_ : int The number of dimensions per case. series_length_ : int The length of each series.
See Also -------- TemporalDictionaryEnsemble, SFA
Notes ----- For the Java version, see `TSML <https://github.com/uea-machine-learning/tsml/blob/master/src/main/java/ tsml/classifiers/dictionary_based/IndividualTDE.java>`_.
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.
Examples -------- >>> from sktime.classification.dictionary_based import IndividualTDE >>> 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) # doctest: +SKIP >>> clf = IndividualTDE() # doctest: +SKIP >>> clf.fit(X_train, y_train) # doctest: +SKIP IndividualTDE(...) >>> y_pred = clf.predict(X_test) # doctest: +SKIP
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-sktime==1.0.0uv pip install sinapsis-sktime==1.0.0uv add sinapsis-sktime==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Optional
Default: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
Path where the trained model will be saved. individualtde_init window_size <class 'int'>: default: 10 word_length <class 'int'>: default: 8 norm <class 'bool'>: default: False levels <class 'int'>: default: 1 igb… Read full field description
Path where the trained model will be saved. individualtde_init window_size <class 'int'>: default: 10 word_length <class 'int'>: default: 8 norm <class 'bool'>: default: False levels <class 'int'>: default: 1 igb <class 'bool'>: default: False alphabet_size <class 'int'>: default: 4 bigrams <class 'bool'>: default: True dim_threshold <class 'float'>: default: 0.85 max_dims <class 'int'>: default: 20 typed_dict <class 'bool'>: default: True n_jobs <class 'int'>: default: 1 random_state typing.Optional[int]: default: None
Required
Default: null
Required
Default: null
Optional
Default: false
Optional
Default: false
Optional
Default: 1
Optional
Default: 1
Optional
Default: true
Optional
Default: 20
Optional
Default: true
Optional
Default: 10
Optional
Default: 8
Optional
Default: null
Optional
Default: 4
Optional
Default: 0.85
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
templates:
- template_name: "IndividualTDESKTimeWrapper"
class_name: "IndividualTDESKTimeWrapper"
attributes:
root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
model_save_path: "<required>"
individualtde_init:
igb: false
norm: false
levels: 1
n_jobs: 1
bigrams: true
max_dims: 20
typed_dict: true
window_size: 10
word_length: 8
random_state: null
alphabet_size: 4
dim_threshold: 0.85
Inheritance
sinapsis_sktime.templates.sktime_classifiers.SKTimeDictionaryClassifiersEnvironment variables
Environment definitions belong to their canonical Python modules.