Skip to main content

Kernel-change-point-detection



Kernel change point detection is a python library used for anomaly detection on time-series.

Getting started

This library has been tested on Python 3.11 and 3.12.

Setting environement

pip install virtualenv
virtualenv -p <path/to/python3.11> myenv
source myenv/bin/activate

Installation

Once your virtual environment is activated, you can install the Kernel-point-change-detection library directly from Pypi by typing :

pip install kcpdi

This command will install the kcpdi package and all required dependencies. Within your python code, you can then access the library functions by using the following import statement:

import kcpdi

Usage

Our algorithm takes pre-processed (interpolated to a fixed time grid, normalized, etc.) and offline (not streaming) multidimensional time series data and runs linear kernel anomaly/change-point detection on it in order to output a list of likely anomaly/change-points in time. The method is based on results in Arlot et al. (2019).

We have started to develop automated post-hoc visualization tools in order to provide intuitive explicability in the output results in order to attribute a ranked (in terms of importance) list of individual time series for each detected anomaly/change-point. This is because it is otherwise difficult to know 'why' a change-point was detected at a certain point if there are hundreds or thousands of individual concurrent time series. The latter tool is semi-dependent of the anomaly/change-point detection step.

Examples and demonstrators

The following notebook incorporates the most important features:

TADkit link

In order to allow the kernel change-point method to be compatible with the Time-series Anomaly Detection kit TADkit, we have implemented a function kcp_ss which takes the kcp_ds output list of change-points and turns them into scores at all time indices.

We give a score of 1 at each detected change-point. We define a decay_parameter $γ$ (default $γ = 1$). Then :

  • For any time index that exactly corresponds to a detected change-point index, its score is 1.

  • For any time index $t_x$ before the first detected change-point time index $t_1$, its score is :

$$\left(\frac{1}{2}\right)^{\gamma |t_1 - t_x|}$$

  • For any time index $t_x$ after the last detected change-point time index $t_{last}$ its score is :

$$\left(\frac{1}{2}\right)^{\gamma |t_{last} - t_x|}$$

  • For any time index $t_x$ between change-point time indices $t_{j}$ and $t_{j+1}$ , its score is the average of the left and right scores :

$$ \frac{1}{2}\left(\left(\frac{1}{2}\right)^{\gamma |t_{j} - t_{x}|} + \left(\frac{1}{2}\right)^{\gamma |t_{j+1}-t_{x}|} \right) $$

Contributors and Support

Responsible : Kevin Bleakley, Sylvain Arlot (INRIA)

Kernel change point detection is a library developed by INRIA and supported by the

Release files for kcpdi 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kcpdi 0.1.1
File Size Uploaded
kcpdi-0.1.1.tar.gz 19.5 kB Details

Release files / kcpdi-0.1.1.tar.gz

Download URL kcpdi-0.1.1.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
50b61e63687e1ec3245e25e905790e8d385a8a07ed01e67883f8a265e3bf2085
BLAKE2b-256 checksum
How to use checksums
92d91b26c658adf6c5bad92e9729c4b16a71f5a8ed57e071b017a1d3f495856e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page