Skip to main content

Leakage-safe, event-wise and affiliation-based evaluation for spacecraft-telemetry anomaly detection

Project description

telemeval

CI PyPI Python License DOI

Leakage-safe, event-wise and affiliation-based evaluation for spacecraft-telemetry anomaly detection.

Status: v0.x — early releases; the API may still change until v1.

Time-series anomaly-detection evaluation is notoriously easy to get wrong: point-adjusted F1 can rank random predictions above real detectors, and subtle protocol bugs (like scoring training-window events against test-window predictions) silently inflate or deflate results. The metrics the literature recommends instead — corrected event-wise F-beta and affiliation-based precision/recall — have not had a maintained, permissively-licensed, pip-installable home.

telemeval is that home:

  • A validated ingestion contract that raises typed, actionable errors instead of producing a number from a leaky or malformed evaluation — including a first-class train/test-window leakage guard.
  • Event-wise precision / recall / F-beta with unambiguous, documented overlap semantics (recall matches ESA-ADB's event-wise recall exactly; precision is telemeval's run-based definition — the differences from ESA-ADB's TNR-corrected EW_* are documented and pinned by divergence tests, and an ESAScores-parity metric is on the roadmap).
  • Affiliation-based precision / recall — the canonical reference implementation (Huet et al., KDD 2022, MIT) vendored, wrapped, tested, and maintained here.
  • ADTQC detection-timing quality (ESA-ADB) — scores when each event was first caught, not just whether; previously available only inside ESA-ADB's research fork.
  • Channel- and subsystem-aware F-beta (ESA-ADB) — did you flag the right source? Verified against the reference test suite's exact expected values.
  • Honest reports: deterministic JSON and Markdown output stamped with explicit scope caveats.
  • Telemetry-aware inputs: channel-keyed predictions (interval labels, binary masks, or continuous scores + threshold), an ESA-ADB-format loader, and a TimeEval-format reader.
  • scikit-learn-style metric wrappers so the metrics drop into existing scoring code.

Core dependencies: numpy and pandas. Nothing else.

Quick start

import pandas as pd
from telemeval import evaluate

labels = pd.DataFrame(
    {
        "ID": ["anomaly_1"],
        "Channel": ["channel_41"],
        "StartTime": ["2024-01-01T00:02:00"],
        "EndTime": ["2024-01-01T00:03:00"],
    }
)
timestamps = pd.date_range("2024-01-01", periods=6, freq="1min")
predictions = {
    "channel_41": pd.DataFrame({"Timestamp": timestamps, "Score": [0, 0, 1, 1, 0, 0]})
}

result = evaluate(labels, predictions, dataset="my-mission")
print(result.metrics["event_wise"]["event_wise_fbeta"])     # 1.0
print(result.metrics["affiliation"]["affiliation_fbeta"])   # 1.0
result.save(json_path="report.json", markdown_path="report.md")

See docs/usage.md for the leakage guard, continuous scores + threshold, ESA-ADB and TimeEval-format loaders, parquet input, sklearn-style wrappers, and the metric registry. See docs/related-work.md for an honest map of prior art and when to use which tool.

What telemeval is not

  • Not a detector library (see PyOD, aeon, darts).
  • Not a benchmark harness or dataset collection (see TimeEval, TSB-AD).
  • Not a serving/monitoring/MLOps stack.
  • Not affiliated with or endorsed by ESA; it does not redistribute the ESA Anomaly Dataset.

Prior art worth knowing: TSADmetrics (GPL-3.0, generic time-series AD metrics), TSB-AD (benchmark suite), Merlion (point-adjusted F1), aeon (range/VUS metrics). telemeval's niche is the permissive license, the telemetry-domain contract with leakage guards, and maintained affiliation metrics; where metrics overlap we aim to reproduce prior-art numbers.

License

Apache-2.0. Vendored affiliation reference implementation is MIT (retained; see NOTICE). Dataset licenses (e.g. ESA Anomaly Dataset, CC BY 3.0 IGO) are separate from this code and are never bundled.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telemeval-0.3.1.tar.gz (87.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telemeval-0.3.1-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file telemeval-0.3.1.tar.gz.

File metadata

  • Download URL: telemeval-0.3.1.tar.gz
  • Upload date:
  • Size: 87.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for telemeval-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7ec8ec54f2130495aa4adfab8ada3176ebac18c9e4e544a6241bf312043fadb3
MD5 7963f3403d84cf56c241bc5d6e9d9c4d
BLAKE2b-256 af4244b16d4d3ea7d352facb26b8438c2622bc91a7d7d79d77c5c4f592cd4d7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for telemeval-0.3.1.tar.gz:

Publisher: release.yml on rosscyking1115/telemeval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file telemeval-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: telemeval-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for telemeval-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3266f966b4d0a088f94b05d4f0b1c80024b20ca2d27bcd2412a3ceef7f2dc16
MD5 e2c02d28d19f2168c0f020248e6c8f73
BLAKE2b-256 265b8b54f2d907bff17de883ca130d10ee20cccefd64be1125900412095e5c04

See more details on using hashes here.

Provenance

The following attestation bundles were made for telemeval-0.3.1-py3-none-any.whl:

Publisher: release.yml on rosscyking1115/telemeval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page