tsseg.algorithms.icid package

iCID — Isolation Distributional Kernel Change Interval Detection.

Description

iCID detects change intervals by projecting the time series into a high-dimensional distributional feature space (aNNEspace) and measuring cosine-distance dissimilarity between consecutive sliding windows. A z-score-based threshold \(\alpha\) determines whether a dissimilarity peak constitutes a true change.

The method is non-parametric, does not assume Gaussianity, and automatically selects the granularity through a list of psi (sub-sample) values.

Type: change point detection
Supervision: fully unsupervised
Scope: univariate and multivariate

Parameters

Name

Type

Default

Description

window_size

int

50

Sliding window size for computing dissimilarity.

alpha

float

0.5

Sensitivity factor (higher = less sensitive).

t

int

200

Iterations for aNNEspace transformation.

psi_list

list[int] / None

[2,4,8,16,32,64]

Sub-sample sizes controlling granularity.

axis

int

0

Time axis.

Usage

from tsseg.algorithms import ICIDDetector

detector = ICIDDetector(window_size=100, alpha=0.3)
labels = detector.fit_predict(X)

Implementation: Origin: new code.

Reference: Cao, Ting, Liu, Cek & Angelova (2024), A new framework for change interval detection, JAIR.

Submodules

tsseg.algorithms.icid.detector module

class tsseg.algorithms.icid.detector.ICIDDetector(window_size=50, alpha=0.5, t=200, psi_list=None, axis=0)[source]

Bases: BaseSegmenter

Isolation Distributional Kernel Change Interval Detection (iCID).

This is a Python implementation of the iCID algorithm, adapted for the aeon framework, from the original MATLAB code by Yang Cao et al. [1].

iCID detects change intervals by transforming the time series into a high- dimensional distributional feature space and then identifying dissimilarities between consecutive windows.

The algorithm works in four main steps:

  1. aNNEspace Transformation: Projects the data into a feature space using random subsampling to create a distributional kernel.

  2. Dissimilarity Scoring: Computes a point-wise dissimilarity score by calculating the cosine distance between the mean embeddings of consecutive windows in the transformed space.

  3. Automatic `psi` Selection: The granularity parameter psi is automatically selected by finding the one that minimizes the approximate entropy of the resulting dissimilarity score series.

  4. Adaptive Thresholding: Change points are detected by applying an adaptive threshold to the final dissimilarity score.

Parameters:
  • window_size (int, default=50) – The size of the window_size_size for computing the dissimilarity score.

  • alpha (float, default=0.5) – The sensitivity factor for the detection threshold. A higher value makes the detection less sensitive.

  • t (int, default=200) – The number of iterations for the aNNEspace transformation, controlling the dimensionality of the feature space.

  • psi_list (list of int, default=[2, 4, 8, 16, 32, 64]) – The list of psi values to test for granularity. The best one is selected automatically.

  • axis (int, default=0) – The axis to segment along if passed a multivariate series.

References

set_fit_request(*, axis: bool | None | str = '$UNCHANGED$') ICIDDetector

Configure whether metadata should be requested to be passed to the fit method.

Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with enable_metadata_routing=True (see sklearn.set_config()). Please check the User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to fit if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to fit.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Parameters:

axis (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for axis parameter in fit.

Returns:

self – The updated object.

Return type:

object

set_predict_request(*, axis: bool | None | str = '$UNCHANGED$') ICIDDetector

Configure whether metadata should be requested to be passed to the predict method.

Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with enable_metadata_routing=True (see sklearn.set_config()). Please check the User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to predict if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to predict.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Parameters:

axis (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for axis parameter in predict.

Returns:

self – The updated object.

Return type:

object

Module contents