{"id":15350486,"url":"https://github.com/takuti/anompy","last_synced_at":"2025-04-15T04:17:44.084Z","repository":{"id":147156015,"uuid":"70964576","full_name":"takuti/anompy","owner":"takuti","description":"A Python library for anomaly detection","archived":false,"fork":false,"pushed_at":"2017-08-28T08:04:00.000Z","size":35,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T04:17:36.155Z","etag":null,"topics":["anomaly-detection","data-science","forecasting","machine-learning","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takuti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-10-15T03:50:31.000Z","updated_at":"2020-08-26T08:10:55.000Z","dependencies_parsed_at":"2023-09-22T07:01:48.998Z","dependency_job_id":null,"html_url":"https://github.com/takuti/anompy","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"9b89449ee2e6b9c90ac60eb3cbcdb8ee3ee52bc1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuti%2Fanompy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuti%2Fanompy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuti%2Fanompy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuti%2Fanompy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takuti","download_url":"https://codeload.github.com/takuti/anompy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003971,"owners_count":21196793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anomaly-detection","data-science","forecasting","machine-learning","python"],"created_at":"2024-10-01T11:58:32.753Z","updated_at":"2025-04-15T04:17:44.062Z","avatar_url":"https://github.com/takuti.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"anompy\n===\n\n**anompy** is a Python package of forecasting and anomaly detection algorithms.\n\n## Installation\n\n```\n$ pip install git+https://github.com/takuti/anompy.git\n```\n\n## Usage\n\nGenerate dummy time-series:\n\n```py\n\u003e\u003e\u003e import random\n\u003e\u003e\u003e series = [random.random() for i in range(10)]\n\u003e\u003e\u003e series\n[0.29749066250070444, 0.17992724665541393, 0.24201406949661697, 0.3467356134915024, 0.45318143064943217, 0.20825014566859423, 0.597497516445304, 0.5442072127508967, 0.1920841531842088, 0.2711214524302953]\n```\n\nImport `BaseDetector` which simply returns the last observed data point as a forecasted value, and create a detector with initial data point (i.e., training sample) and threshold:\n\n```py\n\u003e\u003e\u003e from anompy.detector.base import BaseDetector\n\u003e\u003e\u003e detector = BaseDetector(series[0], threshold=0.5)\n```\n\nGet forecasted time-series and their anomaly labels by calling `detect()` method:\n\n```py\n\u003e\u003e\u003e detector.detect(series[1:])\n[(0.29749066250070444, False), (0.17992724665541393, False), (0.24201406949661697, False), (0.3467356134915024, False), (0.45318143064943217, False), (0.20825014566859423, False), (0.597497516445304, True), (0.5442072127508967, True), (0.1920841531842088, False)]\n```\n\nSee [this notebook](https://gist.github.com/takuti/36d54e432a49424bb31d948926cd49b4) for more examples.\n\n## Algorithm\n\nanompy currently supports following algorithms:\n\n- `BaseDetector`\n    - Directly use the last observation as a forecasted value, and detect anomaly based on threshold.\n- `AverageDetector`\n    - Forecast either global average, simple moving average or weighted moving average.\n- `ExponentialSmoothing`, `DoubleExponentialSmoothing`, and `TripleExponentialSmoothing`\n    - See [\"Exponential smoothing\" on Wikipedia](https://en.wikipedia.org/wiki/Exponential_smoothing).\n    - Triple exponential smoothing is also known as Holt-Winters method.\n- Experimental\n    - `ChangeFinder`\n    - `SingularSpectrumTransform`\n    - `StreamAnomalyDetector`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuti%2Fanompy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakuti%2Fanompy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuti%2Fanompy/lists"}