Back to models
Transformer

ClaSPTransformer

ClaSP (Classification Score Profile) Transformer.

Implementation of the Classification Score Profile of a time series. ClaSP hierarchically splits a TS into two parts, where each split point is determined by training a binary TS classifier for each possible split point and selecting the one with highest accuracy, i.e., the one that is best at identifying subsequences to be from either of the partitions.

Quickstart

python
from sktime.transformations.clasp import ClaSPTransformer

estimator = ClaSPTransformer(window_length=10, scoring_metric='ROC_AUC', exclusion_radius=0.05)

Tags

Capabilities

  • Unequal-length series
  • Multivariate: Not supported
  • Inverse transform: Not supported
  • Missing values: Not supported
  • Removes missing values: Not supported
  • Equalizes series length: Not supported

Properties

Input typescitype:transform-input
Series
Output typescitype:transform-output
Series
Label typescitype:transform-labels
None
Fit is emptyfit_is_empty
Yes
Keeps the time indextransform-returns-same-time-index
No
Requires Xrequires_X
Yes
Requires yrequires_y
No
X and y need the same indexX-y-must-have-same-index
No

Parameters(3)

window_lengthint, default = 10
size of window for sliding.
scoring_metricstring, default = ROC_AUC
the scoring metric to use in ClaSP - choose from ROC_AUC or F1
exclusion_radiusint
Exclusion Radius for change points to be non-trivial matches

Examples

>>> from sktime.transformations.clasp import ClaSPTransformer
>>> from sktime.detection.clasp import find_dominant_window_sizes
>>> from sktime.datasets import load_electric_devices_segmentation
>>> X, true_period_size, true_cps = load_electric_devices_segmentation ()
>>> dominant_period_size = find_dominant_window_sizes (X)
>>> clasp = ClaSPTransformer (window_length = dominant_period_size)
>>> clasp. fit (X)
>>> profile = clasp. transform (X)