Time series detection tasks#

The sktime.detection module contains algorithms and tools for time series detection tasks, including:

  • anomaly or outlier detection

  • change point detection

  • time series segmentation and segment detection

The tasks include unsupervised and semi-supervised variants, and can batch or stream/online detection.

All detectors in sktime can be listed using the sktime.registry.all_estimators utility, using estimator_types="detector", optionally filtered by tags.

Valid tags are listed in the detector tags API reference, and can be listed using sktime.registry.all_tags.

Composition#

DetectorPipeline(steps)

Pipeline for time series anomaly, changepoint detection, segmentation.

DetectorAsTransformer(estimator)

Use an anomaly, changepoint detector, segmentation estimator as a transformer.

Change Point Detection#

crops.CROPS(cost, min_penalty, max_penalty)

CROPS algorithm for path solutions to the PELT algorithm.

moving_window.MovingWindow([change_score, ...])

Moving window (MOSUM) changepoint detection algorithm.

pelt.PELT([cost, penalty, ...])

Pruned Exact Linear Time (PELT) changepoint detection.

seeded_binseg.SeededBinarySegmentation([...])

Seeded binary segmentation algorithm for changepoint detection.

Naive Baselines#

DummyRegularChangePoints([step_size])

Dummy change point detector which detects a change point every x steps.

ZeroChangePoints()

Dummy change point detector which detects no change points ever.

Time Series Point Anomaly Detection#

Point anomaly detectors identify single anomalous indices.

Window-based Anomaly Detection#

SubLOF(n_neighbors, window_size, *[, ...])

Timeseries version of local outlier factor.

HampelDetector([window_length, n_sigma, k])

Anomaly detector based on Hampel filter described in [1].

Foundation Models for Anomaly Detection#

Anomaly detection using foundational models.

MomentFMAnomalyDetector([...])

Interface for anomaly detection with the deep learning time series model momentfm.

TSPulseAnomalyDetector([model_path, ...])

Anomaly detector wrapping IBM TSPulse via granite-tsfm.

Reduction to Tabular Anomaly Detection#

PyODDetector(estimator[, labels])

Transformer that applies outlier detector from pyOD.

Naive Baselines#

DummyRegularAnomalies([step_size])

Dummy change point detector which detects a change point every x steps.

ZeroAnomalies()

Dummy anomaly detector which detects no anomalies ever.

ThresholdDetector([upper, lower, mode])

Naive detector which detects all points outside a threshold.

Time Series Segment Anomaly Detection#

Segment anomaly detectors identify anomalous segment.

capa.CAPA([segment_saving, segment_penalty, ...])

The collective and point anomaly (CAPA) detection algorithm.

circular_binseg.CircularBinarySegmentation([...])

Circular binary segmentation for multiple segment anomaly detection.

stat_threshold.StatThresholdAnomaliser(...)

Anomaly detection by thresholding segment statistics.

Naive Baselines#

ZeroSegments()

Dummy segments detector which detects no segments.

ThresholdDetector([upper, lower, mode])

Naive detector which detects all points outside a threshold.

Time Series Segmentation#

ClaSPSegmentation([period_length, n_cps, ...])

ClaSP (Classification Score Profile) Segmentation.

EAgglo([member, alpha, penalty])

Hierarchical agglomerative estimation of multiple change points.

GaussianHMM([n_components, covariance_type, ...])

Hidden Markov Model with Gaussian emissions.

GMMHMM([n_components, n_mix, min_covar, ...])

Hidden Markov Model with Gaussian mixture emissions.

GreedyGaussianSegmentation([k_max, lamb, ...])

Greedy Gaussian Segmentation Estimator.

HMM(emission_funcs, transition_prob_mat[, ...])

Implements a simple HMM fitted with Viterbi algorithm.

InformationGainSegmentation([k_max, step])

Information Gain based Temporal Segmentation (IGTS) Estimator.

PoissonHMM([n_components, startprob_prior, ...])

Hidden Markov Model with Poisson emissions.

STRAY([alpha, k, knn_algorithm, p, ...])

STRAY: robust anomaly detection in data streams with concept drift.

BinarySegmentation(threshold[, ...])

Binary segmentation change point detector.

Reduction to clustering#

ClusterSegmenter([clusterer])

Cluster-based Time Series Segmentation.

WindowSegmenter([clusterer, window_size, ...])

Window-based Time Series Segmentation via Clustering.

Naive Baselines#

ZeroSegments()

Dummy segments detector which detects no segments.