Docs /Templates/ sinapsis-sktime

Catch22ClassifierSKTimeWrapper

sinapsis-sktimeSKTimedynamicinferencemodelsprediction

Python template · sinapsis_sktime.templates.sktime_classifiers

Overview

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

Catch22Classifier — inherited documentation

Canonical Time-series Characteristics (catch22) classifier.

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

Shorthand for the pipeline ``Catch22(outlier_norm, replace_nans) * estimator``

Parameters ---------- outlier_norm : bool, optional, default=False Normalise each series during the two outlier Catch22 features, which can take a while to process for large values. replace_nans : bool, optional, default=True Replace NaN or inf values from the Catch22 transform with 0. estimator : sklearn classifier, optional, default=None An sklearn estimator to be built using the transformed data. Defaults to sklearn RandomForestClassifier(n_estimators=200) n_jobs : int, optional, 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, optional, 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. estimator_ : ClassifierPipeline Catch22Classifier as a ClassifierPipeline, fitted to data internally

See Also -------- Catch22

Notes ----- Authors `catch22ForestClassifier <https://github.com/chlubba/sktime-catch22>`_.

For the Java version, see `tsml <https://github.com/uea-machine-learning/tsml/blob /master/src/main/java/tsml/classifiers/hybrids/Catch22Classifier.java>`_.

References ---------- .. [1] Lubba, Carl H., et al. "catch22: Canonical time-series characteristics." Data Mining and Knowledge Discovery 33.6 (2019): 1821-1852. https://link.springer.com/article/10.1007/s10618-019-00647-x

Examples -------- >>> from sktime.classification.feature_based import Catch22Classifier >>> 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) # doctest: +SKIP >>> clf = Catch22Classifier( ... estimator=RandomForestClassifier(n_estimators=5), ... outlier_norm=True, ... ) # doctest: +SKIP >>> clf.fit(X_train, y_train) # doctest: +SKIP Catch22Classifier(...) >>> y_pred = clf.predict(X_test) # doctest: +SKIP

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. catch22classifier_init outlier_norm <class 'bool'>: default: False replace_nans <class 'bool'>: default: True estimator <class 'NoneType'>: default: None n_jobs <class… Read full field description

Path where the trained model will be saved. catch22classifier_init outlier_norm <class 'bool'>: default: False replace_nans <class 'bool'>: default: True estimator <class 'NoneType'>: default: None n_jobs <class 'int'>: default: 1 random_state typing.Optional[int]: default: None

str
Required
Default: null
catch22classifier_initRequired
Catch22ClassifierAttributes
Required
Default: null
n_jobs
int
Optional
Default: 1
estimator
NoneType
Optional
Default: null
outlier_norm
bool
Optional
Default: false
random_state
typing.Optional[int]
Optional
Default: null
replace_nans
bool
Optional
Default: true

Configuration example

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

yaml
templates:
  - template_name: "Catch22ClassifierSKTimeWrapper"
    class_name: "Catch22ClassifierSKTimeWrapper"
    attributes:
      root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
      model_save_path: "<required>"
      catch22classifier_init:
        n_jobs: 1
        estimator: null
        outlier_norm: false
        random_state: null
        replace_nans: 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