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.
Parameters
Name |
Type |
Default |
Description |
|---|---|---|---|
|
int |
|
Sliding window size for computing dissimilarity. |
|
float |
|
Sensitivity factor (higher = less sensitive). |
|
int |
|
Iterations for aNNEspace transformation. |
|
list[int] / None |
|
Sub-sample sizes controlling granularity. |
|
int |
|
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:
BaseSegmenterIsolation 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:
aNNEspace Transformation: Projects the data into a feature space using random subsampling to create a distributional kernel.
Dissimilarity Scoring: Computes a point-wise dissimilarity score by calculating the cosine distance between the mean embeddings of consecutive windows in the transformed space.
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.
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
fitmethod.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(seesklearn.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 tofitif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it tofit.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.
- set_predict_request(*, axis: bool | None | str = '$UNCHANGED$') ICIDDetector
Configure whether metadata should be requested to be passed to the
predictmethod.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(seesklearn.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 topredictif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it topredict.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.