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.9, < 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)
detector.fit_predict(df)
>>>
0     49
1     99
2    149
3    199
4    249
5    299
6    349
7    399
8    449
Name: changepoint, dtype: int64

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")
detector.fit_predict(df)
>>>
  anomaly_interval anomaly_columns
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.6.0.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

skchange-0.6.0-py3-none-any.whl (70.8 kB view details)

Uploaded Python 3

File details

Details for the file skchange-0.6.0.tar.gz.

File metadata

  • Download URL: skchange-0.6.0.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.11

File hashes

Hashes for skchange-0.6.0.tar.gz
Algorithm Hash digest
SHA256 bfe358d8bef50f34660a3fd3a9219ca7eaddec49d83fbbb38ef13fe9b99412ee
MD5 4ac61aa5ef3cf45b4089cd286eb50f4f
BLAKE2b-256 a7439daaf62dc9c0aa4f461b17946c8414ac858dd2d29d3d98c4b834d149296a

See more details on using hashes here.

File details

Details for the file skchange-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: skchange-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 70.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.11

File hashes

Hashes for skchange-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a03276f10d1b8206fdf4b80cd15dde0b5419c7815c4b83fdbddb1216f512c7b8
MD5 522fab3f29a6d32b96480720edcc1f77
BLAKE2b-256 5f374f79fd8feb74dda31f77128970a44131b74445d2c31479d5a84890370a6f

See more details on using hashes here.

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