iCID#

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
Complexity: \(O(d\,n + n^{2})\) for each value of psi_list: the approximate entropy that selects psi compares all pairs of points of the score

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)
change_points = detector.fit_predict(X)

Implementation: Python translation of the authors’ MATLAB code (IsolationKernel/iCID: aNNEspace, point_score, best_psi, best_threshold), which is not shipped with tsseg. GPLv3; a copy of the licence is in tsseg/algorithms/icid/LICENSE. The MATLAB code labels each point 0 or 1 against the threshold; returning the first point of each run of 1 as a change point is specific to tsseg. Origin: adapted from the original MATLAB code.

Reference: Cao, Zhu, Ting, Salim, Li, Yang & Li (2024), Detecting Change Intervals with Isolation Distributional Kernel, JAIR 79, 273–306.

API reference#

class 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 or None, default=None) – The list of psi values to test for granularity. The best one is selected automatically. None means [2, 4, 8, 16, 32, 64].

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

References

set_fit_request(*, axis='$UNCHANGED$')#

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 (Union[bool, None, str]) – Metadata routing for axis parameter in fit.

Returns:

self – The updated object.

Return type:

ICIDDetector

set_predict_request(*, axis='$UNCHANGED$')#

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 (Union[bool, None, str]) – Metadata routing for axis parameter in predict.

Returns:

self – The updated object.

Return type:

ICIDDetector