Docs /Templates/ sinapsis-sktime

TSFreshClassifierSKTimeWrapper

sinapsis-sktimeSKTimedynamicinferencemodelsprediction

Python template · sinapsis_sktime.templates.sktime_classifiers

Overview

Template for SkTime classification model training and inference for the feature_based module.

TSFreshClassifier — inherited documentation

Time Series Feature Extraction based on Scalable Hypothesis Tests classifier.

This classifier simply transforms the input data using the TSFresh [1] transformer and builds a provided estimator using the transformed data.

Parameters ---------- default_fc_parameters : str, default="efficient" Set of TSFresh features to be extracted, options are "minimal", "efficient" or "comprehensive". relevant_feature_extractor : bool, default=False Remove irrelevant features using the FRESH algorithm. estimator : sklearn classifier, default=None An sklearn estimator to be built using the transformed data. Defaults to a Random Forest with 200 trees. verbose : int, default=0 level of output printed to the console (for information only) n_jobs : int, default=1 The number of jobs to run in parallel for both ``fit`` and ``predict``. ``-1`` means using all processors. chunksize : int or None, default=None Number of series processed in each parallel TSFresh job, should be optimised for efficient parallelisation. random_state : int or None, default=None Seed for random, integer.

Attributes ---------- n_classes_ : int Number of classes. Extracted from the data. classes_ : ndarray of shape (n_classes_) Holds the label for each class.

See Also -------- TSFreshFeatureExtractor, TSFreshRelevantFeatureExtractor

References ---------- .. [1] Christ, Maximilian, et al. "Time series feature extraction on basis of scalable hypothesis tests (tsfresh-a python package)." Neurocomputing 307 (2018): 72-77. https://www.sciencedirect.com/science/article/pii/S0925231218304843

Examples -------- >>> from sktime.classification.feature_based import TSFreshClassifier >>> from sklearn.ensemble import RandomForestClassifier >>> 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 = TSFreshClassifier( ... estimator=RandomForestClassifier(n_estimators=5), ... default_fc_parameters="efficient", ... ) >>> clf.fit(X_train, y_train) TSFreshClassifier(...) >>> y_pred = clf.predict(X_test)

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-sktime==1.0.0
uv pip install sinapsis-sktime==1.0.0
uv add sinapsis-sktime==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
root_dir
str
Optional
Default: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
model_save_pathRequired
Path where the trained model will be saved. tsfreshclassifier_init default_fc_parameters <class 'str'>: default: efficient relevant_feature_extractor <class 'bool'>: default: True estimator <class 'NoneType'>: default:… Read full field description

Path where the trained model will be saved. tsfreshclassifier_init default_fc_parameters <class 'str'>: default: efficient relevant_feature_extractor <class 'bool'>: default: True estimator <class 'NoneType'>: default: None verbose <class 'int'>: default: 0 n_jobs <class 'int'>: default: 1 chunksize typing.Optional[int]: default: None random_state typing.Optional[int]: default: None

str
Required
Default: null
tsfreshclassifier_initRequired
TSFreshClassifierAttributes
Required
Default: null
n_jobs
int
Optional
Default: 1
verbose
int
Optional
Default: 0
chunksize
typing.Optional[int]
Optional
Default: null
estimator
NoneType
Optional
Default: null
random_state
typing.Optional[int]
Optional
Default: null
default_fc_parameters
str
Optional
Default: "efficient"
relevant_feature_extractor
bool
Optional
Default: true

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "TSFreshClassifierSKTimeWrapper"
    class_name: "TSFreshClassifierSKTimeWrapper"
    attributes:
      root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
      model_save_path: "<required>"
      tsfreshclassifier_init:
        n_jobs: 1
        verbose: 0
        chunksize: null
        estimator: null
        random_state: null
        default_fc_parameters: "efficient"
        relevant_feature_extractor: true

Inheritance

Immediate parent: sinapsis_sktime.templates.sktime_classifiers.SKTimeFeatureClassifiers

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_BUILD_DOCS · defined elsewhere