skchange


Nameskchange JSON
Version 0.10.0 PyPI version JSON
download
home_pageNone
SummarySktime-compatible change and anomaly detection
upload_time2024-12-13 08:03:29
maintainerNone
docs_urlNone
authorNone
requires_python<3.14,>=3.9
licenseNone
keywords data-science machine-learning statistics scikit-learn time-series change-detection anomaly-detection
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # [`skchange`](https://skchange.readthedocs.io/en/latest/)

[![codecov](https://codecov.io/gh/NorskRegnesentral/skchange/graph/badge.svg?token=QSS3AY45KY)](https://codecov.io/gh/NorskRegnesentral/skchange)
[![tests](https://github.com/NorskRegnesentral/skchange/actions/workflows/tests.yaml/badge.svg)](https://github.com/NorskRegnesentral/skchange/actions/workflows/tests.yaml)
[![docs](https://readthedocs.org/projects/skchange/badge/?version=latest)](https://skchange.readthedocs.io/en/latest/?badge=latest)
[![BSD 3-clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/sktime/sktime/blob/main/LICENSE)
[![!black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Python](https://img.shields.io/pypi/pyversions/skchange)](https://pypi.org/project/skchange/)

[`skchange`]((https://skchange.readthedocs.io/en/latest/)) provides [`sktime`](https://www.sktime.net/)-compatible change detection and changepoint-based anomaly detection algorithms.

Experimental but maturing.

## Documentation
[Docs](https://skchange.readthedocs.io/) | [Notebook tutorial](https://github.com/sktime/sktime-tutorial-pydata-global-2024)


## Installation
It is recommended to install skchange with [`numba`](https://numba.readthedocs.io/en/stable/) for faster performance:
```sh
pip install skchange[numba]
```

Alternatively, you can install `skchange` without `numba`:
```sh
pip install skchange
```

## Quickstart

### Changepoint detection / time series segmentation
```python
from skchange.change_detectors.moving_window import MovingWindow
from skchange.datasets.generate import generate_alternating_data

df = generate_alternating_data(n_segments=10, segment_length=50, mean=5, random_state=1)

detector = MovingWindow(bandwidth=10)
detector.fit_predict(df)
```
```python
   ilocs
0     50
1    100
2    150
3    200
4    250
5    300
6    350
7    400
8    450
```

### Multivariate anomaly detection
```python
import numpy as np
from skchange.anomaly_detectors import MVCAPA
from skchange.datasets.generate import generate_anomalous_data

n = 300
anomalies = [(100, 120), (250, 300)]
means = [[8.0, 0.0, 0.0], [2.0, 3.0, 5.0]]
df = generate_anomalous_data(n, anomalies, means, random_state=3)

detector = MVCAPA()
detector.fit_predict(df)
```
```python
        ilocs  labels   icolumns
0  [100, 120)       1        [0]
1  [250, 300)       2  [2, 1, 0]
```

## License

`skchange` is a free and open-source software licensed under the [BSD 3-clause license](https://github.com/NorskRegnesentral/skchange/blob/main/LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "skchange",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.9",
    "maintainer_email": "Martin Tveten <tveten@nr.no>, Johannes Voll Kolst\u00f8 <jvkolsto@nr.no>",
    "keywords": "data-science, machine-learning, statistics, scikit-learn, time-series, change-detection, anomaly-detection",
    "author": null,
    "author_email": "Martin Tveten <tveten@nr.no>",
    "download_url": "https://files.pythonhosted.org/packages/14/de/16656f92f155eb1c76dd1d6ff992aaaa81b76ed81235ed8b67787a7ce204/skchange-0.10.0.tar.gz",
    "platform": null,
    "description": "# [`skchange`](https://skchange.readthedocs.io/en/latest/)\r\n\r\n[![codecov](https://codecov.io/gh/NorskRegnesentral/skchange/graph/badge.svg?token=QSS3AY45KY)](https://codecov.io/gh/NorskRegnesentral/skchange)\r\n[![tests](https://github.com/NorskRegnesentral/skchange/actions/workflows/tests.yaml/badge.svg)](https://github.com/NorskRegnesentral/skchange/actions/workflows/tests.yaml)\r\n[![docs](https://readthedocs.org/projects/skchange/badge/?version=latest)](https://skchange.readthedocs.io/en/latest/?badge=latest)\r\n[![BSD 3-clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/sktime/sktime/blob/main/LICENSE)\r\n[![!black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n[![Python](https://img.shields.io/pypi/pyversions/skchange)](https://pypi.org/project/skchange/)\r\n\r\n[`skchange`]((https://skchange.readthedocs.io/en/latest/)) provides [`sktime`](https://www.sktime.net/)-compatible change detection and changepoint-based anomaly detection algorithms.\r\n\r\nExperimental but maturing.\r\n\r\n## Documentation\r\n[Docs](https://skchange.readthedocs.io/) | [Notebook tutorial](https://github.com/sktime/sktime-tutorial-pydata-global-2024)\r\n\r\n\r\n## Installation\r\nIt is recommended to install skchange with [`numba`](https://numba.readthedocs.io/en/stable/) for faster performance:\r\n```sh\r\npip install skchange[numba]\r\n```\r\n\r\nAlternatively, you can install `skchange` without `numba`:\r\n```sh\r\npip install skchange\r\n```\r\n\r\n## Quickstart\r\n\r\n### Changepoint detection / time series segmentation\r\n```python\r\nfrom skchange.change_detectors.moving_window import MovingWindow\r\nfrom skchange.datasets.generate import generate_alternating_data\r\n\r\ndf = generate_alternating_data(n_segments=10, segment_length=50, mean=5, random_state=1)\r\n\r\ndetector = MovingWindow(bandwidth=10)\r\ndetector.fit_predict(df)\r\n```\r\n```python\r\n   ilocs\r\n0     50\r\n1    100\r\n2    150\r\n3    200\r\n4    250\r\n5    300\r\n6    350\r\n7    400\r\n8    450\r\n```\r\n\r\n### Multivariate anomaly detection\r\n```python\r\nimport numpy as np\r\nfrom skchange.anomaly_detectors import MVCAPA\r\nfrom skchange.datasets.generate import generate_anomalous_data\r\n\r\nn = 300\r\nanomalies = [(100, 120), (250, 300)]\r\nmeans = [[8.0, 0.0, 0.0], [2.0, 3.0, 5.0]]\r\ndf = generate_anomalous_data(n, anomalies, means, random_state=3)\r\n\r\ndetector = MVCAPA()\r\ndetector.fit_predict(df)\r\n```\r\n```python\r\n        ilocs  labels   icolumns\r\n0  [100, 120)       1        [0]\r\n1  [250, 300)       2  [2, 1, 0]\r\n```\r\n\r\n## License\r\n\r\n`skchange` is a free and open-source software licensed under the [BSD 3-clause license](https://github.com/NorskRegnesentral/skchange/blob/main/LICENSE).\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Sktime-compatible change and anomaly detection",
    "version": "0.10.0",
    "project_urls": {
        "Homepage": "https://skchange.readthedocs.io"
    },
    "split_keywords": [
        "data-science",
        " machine-learning",
        " statistics",
        " scikit-learn",
        " time-series",
        " change-detection",
        " anomaly-detection"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c80db11eacd25977319ae9b5344b40ae4cbb74183478fc6844ef1430fbe491b",
                "md5": "c89a8984b26f1249543ccea5edb75c91",
                "sha256": "b0411f393ec532482f5fb4a8729521f0e3a4aaf6d5c029a2a36141a520f3aadd"
            },
            "downloads": -1,
            "filename": "skchange-0.10.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c89a8984b26f1249543ccea5edb75c91",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.9",
            "size": 7171572,
            "upload_time": "2024-12-13T08:03:24",
            "upload_time_iso_8601": "2024-12-13T08:03:24.949123Z",
            "url": "https://files.pythonhosted.org/packages/1c/80/db11eacd25977319ae9b5344b40ae4cbb74183478fc6844ef1430fbe491b/skchange-0.10.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14de16656f92f155eb1c76dd1d6ff992aaaa81b76ed81235ed8b67787a7ce204",
                "md5": "66f2143bc5cf0a68f663996adaae2157",
                "sha256": "ba4bbb114380f77f4bf1fc1014f2174c9cabeddbaf97e1fb9e34ba7b735acfaf"
            },
            "downloads": -1,
            "filename": "skchange-0.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "66f2143bc5cf0a68f663996adaae2157",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.9",
            "size": 6649268,
            "upload_time": "2024-12-13T08:03:29",
            "upload_time_iso_8601": "2024-12-13T08:03:29.477786Z",
            "url": "https://files.pythonhosted.org/packages/14/de/16656f92f155eb1c76dd1d6ff992aaaa81b76ed81235ed8b67787a7ce204/skchange-0.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-13 08:03:29",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "skchange"
}
        
Elapsed time: 0.82660s