Online Anomaly Detection Models
Project description
ABERRANT
Online anomaly detection for streaming data.
Highlights
- Streaming-first model APIs:
learn_oneandscore_one - Detector families: isolation forests, distance, SVM, statistical
- Dataset streaming API with caching
- Composable transforms and pipelines
Install
pip install aberrant
Optional extras:
aberrant[eval]for evaluation metrics (scikit-learn)aberrant[dl]for deep models (torch)aberrant[parquet]for legacy parquet streaming (pyarrow)aberrant[dev],aberrant[docs],aberrant[benchmark],aberrant[all]
Quick example
from aberrant.model.iforest import OnlineIsolationForest
from aberrant.stream.dataset import Dataset, load
model = OnlineIsolationForest(window_size=512, num_trees=50)
dataset = load(Dataset.SHUTTLE)
for i, (x, y) in enumerate(dataset.stream()):
if i < 2000:
if y == 0:
model.learn_one(x)
continue
score = model.score_one(x)
if score > 0.8:
print("anomaly", score, y)
model.learn_one(x)
Stable public imports
aberrant.driftaberrant.model.iforestaberrant.model.distanceaberrant.model.svmaberrant.model.stataberrant.transform.preprocessingaberrant.transform.projectionaberrant.stream.dataset
Score conventions
ThresholdModel: binary score (0.0or1.0)- Isolation forest variants: bounded score in
[0, 1] - Distance/SVM/statistical models: model-specific continuous scores
Optional dependency behavior
- Deep models are optional (
aberrant[dl]). - Deep unit tests auto-skip when
torchis unavailable. - Integration tests require
aberrant[eval].
Development
uv sync --extra dev --extra docs
uv run python -m ruff check .
uv run python -m pytest -q
Project docs
- Docs site config:
docs/mkdocs.yml - Changelog:
CHANGELOG.md - Contributing:
CONTRIBUTING.md - Security policy:
SECURITY.md
License
MIT (see 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
aberrant-0.5.0.tar.gz
(255.3 kB
view details)
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
aberrant-0.5.0-py3-none-any.whl
(94.9 kB
view details)
File details
Details for the file aberrant-0.5.0.tar.gz.
File metadata
- Download URL: aberrant-0.5.0.tar.gz
- Upload date:
- Size: 255.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
385bd6cdc841e66cd4a4bd6d4ad7a198c661b47118459dd55217026b2f82bc4d
|
|
| MD5 |
0870a6fddc184c11cceec0546ad5220a
|
|
| BLAKE2b-256 |
e3acc0fa68449eca6bf0d2aa3e2c1e13834cdeaa40efe4291f2fb42447f9d3ab
|
File details
Details for the file aberrant-0.5.0-py3-none-any.whl.
File metadata
- Download URL: aberrant-0.5.0-py3-none-any.whl
- Upload date:
- Size: 94.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7d5163fa1819c1d865c20c4dcec3421b68b9d8d19bb80bf9586bf3c320e6506
|
|
| MD5 |
1578ce360b7717dc8b3008d155f67acc
|
|
| BLAKE2b-256 |
1219dda01cbe0439c1d21f4bb275419c4dbd9275233ae1871edc09e197c09567
|