Sktime-compatible change and anomaly detection
Project description
skchange
Breaking changes expected. skchange is undergoing a significant API redesign in upcoming releases. See Issue #120 for more details. If you need stability and the old sktime compatibility, pin to a specific version:
pip install "skchange==0.14.3"
Documentation
Installation
It is recommended to install skchange with numba for faster performance:
pip install skchange[numba]
Alternatively, you can install skchange without numba:
pip install skchange
Quickstart
Changepoint detection / time series segmentation
from skchange.change_detectors import MovingWindow
from skchange.datasets import generate_piecewise_normal_data
df = generate_piecewise_normal_data(
means=[0, 5, 10, 5, 0],
lengths=[50, 50, 50, 50, 50],
seed=1,
)
detector = MovingWindow(bandwidth=20)
detector.fit_predict(df)
ilocs
0 50
1 100
2 150
3 200
Multivariate anomaly detection with variable identification
from skchange.anomaly_detectors import CAPA
from skchange.anomaly_scores import L2Saving
from skchange.compose.penalised_score import PenalisedScore
from skchange.datasets import generate_piecewise_normal_data
from skchange.penalties import make_linear_chi2_penalty
df = generate_piecewise_normal_data(
means=[0, 8, 0, 5],
lengths=[100, 20, 130, 50],
proportion_affected=[1.0, 0.1, 1.0, 0.5],
n_variables=10,
seed=1,
)
score = L2Saving() # Looks for segments with non-zero means.
penalty = make_linear_chi2_penalty(score.get_model_size(1), df.shape[0], df.shape[1])
penalised_score = PenalisedScore(score, penalty)
detector = CAPA(penalised_score, find_affected_components=True)
detector.fit_predict(df)
ilocs labels icolumns
0 [100, 120) 1 [0]
1 [250, 300) 2 [2, 0, 3, 1, 4]
License
skchange is a free and open-source software licensed under the BSD 3-clause license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skchange-0.15.0.tar.gz.
File metadata
- Download URL: skchange-0.15.0.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38cc2fb7910f9cd115b5be1d9978fc0b28a3033713670fb06a2074df3461d5fc
|
|
| MD5 |
d4e79c6bbe46ff958575119c1d0c3e2a
|
|
| BLAKE2b-256 |
bdedfa8c97aebf8529ffaebdb661c75a778d8c247ffcf3b605880a9fdcc8b80f
|
File details
Details for the file skchange-0.15.0-py3-none-any.whl.
File metadata
- Download URL: skchange-0.15.0-py3-none-any.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af45d7f28036339983523d6be29df3e54223a20f71171cb7b8a0e9932ee31a7e
|
|
| MD5 |
292a8c6ab3096b4129c31d43c8d1e956
|
|
| BLAKE2b-256 |
56769e1d2522582eecc0208d57a501e0683ca933174f16ccc4ba800d61025cfe
|