Docs /Templates/ sinapsis-sktime

MatrixProfileClassifierSKTimeWrapper

sinapsis-sktimeSKTimedynamicinferencemodelsprediction

Python template · sinapsis_sktime.templates.sktime_classifiers

Overview

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

MatrixProfileClassifier — inherited documentation

Martrix Profile (MP) classifier.

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

Parameters ---------- subsequence_length : int, default=10 The subsequence length for the MatrixProfile transformer. estimator : sklearn classifier, default=None An sklearn estimator to be built using the transformed data. Defaults to a 1-nearest neighbour classifier. n_jobs : int, default=1 The number of jobs to run in parallel for both ``fit`` and ``predict``. ``-1`` means using all processors. Currently available for the classifier portion only. 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 -------- MatrixProfile

References ---------- .. [1] Yeh, Chin-Chia Michael, et al. "Time series joins, motifs, discords and shapelets: a unifying view that exploits the matrix profile." Data Mining and Knowledge Discovery 32.1 (2018): 83-123. https://link.springer.com/article/10.1007/s10618-017-0519-9

Examples -------- >>> from sktime.classification.feature_based import MatrixProfileClassifier >>> 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 = MatrixProfileClassifier() # doctest: +SKIP >>> clf.fit(X_train, y_train) # doctest: +SKIP MatrixProfileClassifier(...) # doctest: +SKIP >>> 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. matrixprofileclassifier_init subsequence_length <class 'int'>: default: 10 estimator <class 'NoneType'>: default: None n_jobs <class 'int'>: default: 1 random_state typing.Optional[int]: default: None

str
Required
Default: null
matrixprofileclassifier_initRequired
MatrixProfileClassifierAttributes
Required
Default: null
n_jobs
int
Optional
Default: 1
estimator
NoneType
Optional
Default: null
random_state
typing.Optional[int]
Optional
Default: null
subsequence_length
int
Optional
Default: 10

Configuration example

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

yaml
templates:
  - template_name: "MatrixProfileClassifierSKTimeWrapper"
    class_name: "MatrixProfileClassifierSKTimeWrapper"
    attributes:
      root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
      model_save_path: "<required>"
      matrixprofileclassifier_init:
        n_jobs: 1
        estimator: null
        random_state: null
        subsequence_length: 10

Inheritance

Immediate parent: sinapsis_sktime.templates.sktime_classifiers.SKTimeFeatureClassifiers

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_BUILD_DOCS · defined elsewhere