Stateless anomaly scoring library for forecast-based anomaly detection
Project description
spotanomaly2-safe
Features
Version & License
Downloads
Quality
Testing
Scores
Status
Safety-Critical Design Goals
spotanomaly2-safe is a stateless anomaly scoring library for forecast-based anomaly detection in safety-critical production environments.
Unlike general-purpose anomaly detection frameworks, it follows a strict Safety-First architecture by design. However, users must independently verify that these features meet their specific regulatory requirements:
- Zero Side Effects: Takes DataFrames of predictions + true values, returns anomaly scores + flags as DataFrames. Zero I/O, zero config files, zero data fetching.
- Deterministic Logic: The scoring algorithms are designed to be purely mathematical and deterministic.
- Fail-Safe Operation: The system is designed to favor explicit errors over silent failures when encountering invalid data.
- EU AI Act Support: The architecture supports transparency and data governance, helping users build compliant high-risk AI components.
- Minimal Dependencies: Only numpy, pandas, scikit-learn, and scipy — no unnecessary external packages.
For a detailed technical overview of our safety mechanisms, see MODEL_CARD.md.
Installation
uv add spotanomaly2-safe
Usage
from spotanomaly2_safe import ForecastingAnomalyDetector
detector = ForecastingAnomalyDetector(
scorer_name="KMeansScorer",
scorer_params={"n_clusters": 3},
high_quantile=0.99,
normalize_scores=True,
normalization_quantile=0.99,
)
scores_df, flags_df = detector.fit_score_detect(
y_true_train=train_true_df,
y_pred_train=train_pred_df,
y_true_test=test_true_df,
y_pred_test=test_pred_df,
)
Disclaimer & Liability
IMPORTANT: This software is provided "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed.
In no event shall the authors, copyright holders, or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
The use of this software in safety-critical systems is at the sole risk of the user.
Documentation
Documentation (API) will be available at: https://sequential-parameter-optimization.github.io/spotanomaly2-safe/
Contributing
We welcome contributions to spotanomaly2-safe! Please read our CONTRIBUTING.md guide for details on:
- Development setup and coding standards
- Testing and documentation requirements
- Commit message conventions
- Pull request process
- SPDX license header requirements
License
spotanomaly2-safe software: AGPL-3.0-or-later 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 spotanomaly2_safe-0.1.0.tar.gz.
File metadata
- Download URL: spotanomaly2_safe-0.1.0.tar.gz
- Upload date:
- Size: 144.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
642952bcd7277a7f252bd023312e2ef91256b9ad58493d5a42eaba887d2e678f
|
|
| MD5 |
f09ac667d69689890f7cd4c443ddbe75
|
|
| BLAKE2b-256 |
1d76acc04ffef2749ece5562f6cf2933e60600dbd4b5bd9b709d845a472a3df9
|
Provenance
The following attestation bundles were made for spotanomaly2_safe-0.1.0.tar.gz:
Publisher:
release.yml on sequential-parameter-optimization/spotanomaly2-safe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spotanomaly2_safe-0.1.0.tar.gz -
Subject digest:
642952bcd7277a7f252bd023312e2ef91256b9ad58493d5a42eaba887d2e678f - Sigstore transparency entry: 1704288910
- Sigstore integration time:
-
Permalink:
sequential-parameter-optimization/spotanomaly2-safe@1080b024095988b869ee68bc481d8092398a7a1e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sequential-parameter-optimization
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1080b024095988b869ee68bc481d8092398a7a1e -
Trigger Event:
push
-
Statement type:
File details
Details for the file spotanomaly2_safe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spotanomaly2_safe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e293515feaf7b030dbb36f5deaabe6250430baeb1a15577d3979c77b70ab20a6
|
|
| MD5 |
d869b5e1322d87926a68f306f979e144
|
|
| BLAKE2b-256 |
a3319babd340c974596f0dc8c5a85fcd57e25c240b79b0734de6596407989b16
|
Provenance
The following attestation bundles were made for spotanomaly2_safe-0.1.0-py3-none-any.whl:
Publisher:
release.yml on sequential-parameter-optimization/spotanomaly2-safe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spotanomaly2_safe-0.1.0-py3-none-any.whl -
Subject digest:
e293515feaf7b030dbb36f5deaabe6250430baeb1a15577d3979c77b70ab20a6 - Sigstore transparency entry: 1704288954
- Sigstore integration time:
-
Permalink:
sequential-parameter-optimization/spotanomaly2-safe@1080b024095988b869ee68bc481d8092398a7a1e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sequential-parameter-optimization
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1080b024095988b869ee68bc481d8092398a7a1e -
Trigger Event:
push
-
Statement type: