Skip to main content

Sktime-compatible change and anomaly detection

Project description

skchange

skchange provies sktime-compatible change detection and changepoint-based anomaly detection algorithms. Methods implement the annotator interface of sktime.

A playground for now.

codecov tests BSD 3-clause !black

Installation

pip install skchange

Requires Python >= 3.8, < 3.13.

Quickstart

Changepoint detection / time series segmentation

from skchange.change_detectors.moscore import Moscore
from skchange.datasets.generate import generate_teeth_data

df = generate_teeth_data(n_segments=10, segment_length=50, mean=5, random_state=1)
detector = Moscore(bandwidth=10, fmt="sparse")
detector.fit_predict(df)
>>>
0     49
1     99
2    149
3    199
4    249
5    299
6    349
7    399
8    449
Name: changepoints, dtype: int32

Multivariate anomaly detection

from skchange.anomaly_detectors.mvcapa import Mvcapa
from skchange.datasets.generate import generate_teeth_data

df = generate_teeth_data(
    n_segments=5,
    segment_length=50,
    p=10,
    mean=10,
    affected_proportion=0.2,
    random_state=2,
)
detector = Mvcapa(collective_penalty="sparse", fmt="sparse")
detector.fit_predict(df)
>>>
   start  end components
0     50   99     [0, 1]
1    150  199     [0, 1]

License

skchange is a free and open-source software licensed under the BSD 3-clause license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skchange-0.5.2.tar.gz (44.9 kB view hashes)

Uploaded Source

Built Distribution

skchange-0.5.2-py3-none-any.whl (66.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page