Catch22ClassifierSKTimeWrapper
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 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. 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
Required
Default: null
Required
Default: null
Optional
Default: 1
Optional
Default: null
Optional
Default: false
Optional
Default: null
Optional
Default: true
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
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
sinapsis_sktime.templates.sktime_classifiers.SKTimeFeatureClassifiersEnvironment variables
Environment definitions belong to their canonical Python modules.