
Eine Python-Bibliothek zur Anomalieerkennung in tabellarischen Daten, Zeitreihen, Graphen, Text, Bildern und Audiodaten. 60+ Detektoren, benchmark-gestützte ADEngine-Orchestrierung und ein agentischer Workflow für KI-Agenten.
.. image:: https://raw.githubusercontent.com/yzhao062/pyod/master/brand/pyod-icon.svg :target: https://pyod.dev :alt: PyOD Ecosystem :width: 84px
PyOD 3: Agentic Anomaly Detection At Scale
|badge_website| |badge_pypi| |badge_anaconda| |badge_docs| |badge_stars| |badge_forks| |badge_downloads| |badge_testing| |badge_coverage| |badge_maintainability| |badge_license| |badge_benchmark|
.. |badge_website| image:: https://img.shields.io/badge/website-pyod.dev-990000 :target: https://pyod.dev :alt: Website
.. |badge_pypi| image:: https://img.shields.io/pypi/v/pyod.svg?color=brightgreen :target: https://pypi.org/project/pyod/ :alt: PyPI version
.. |badge_anaconda| image:: https://anaconda.org/conda-forge/pyod/badges/version.svg :target: https://anaconda.org/conda-forge/pyod :alt: Anaconda version
.. |badge_docs| image:: https://readthedocs.org/projects/pyod/badge/?version=latest :target: https://pyod.readthedocs.io/en/latest/?badge=latest :alt: Documentation status
.. |badge_stars| image:: https://img.shields.io/github/stars/yzhao062/pyod.svg :target: https://github.com/yzhao062/pyod/stargazers :alt: GitHub stars
.. |badge_forks| image:: https://img.shields.io/github/forks/yzhao062/pyod.svg?color=blue :target: https://github.com/yzhao062/pyod/network :alt: GitHub forks
.. |badge_downloads| image:: https://pepy.tech/badge/pyod :target: https://pepy.tech/project/pyod :alt: Downloads
.. |badge_testing| image:: https://github.com/yzhao062/pyod/actions/workflows/testing.yml/badge.svg :target: https://github.com/yzhao062/pyod/actions/workflows/testing.yml :alt: Testing
.. |badge_coverage| image:: https://coveralls.io/repos/github/yzhao062/pyod/badge.svg :target: https://coveralls.io/github/yzhao062/pyod :alt: Coverage Status
.. |badge_maintainability| image:: https://api.codeclimate.com/v1/badges/bdc3d8d0454274c753c4/maintainability :target: https://codeclimate.com/github/yzhao062/Pyod/maintainability :alt: Maintainability
.. |badge_license| image:: https://img.shields.io/github/license/yzhao062/pyod.svg :target: https://github.com/yzhao062/pyod/blob/master/LICENSE :alt: License
.. |badge_benchmark| image:: https://img.shields.io/badge/ADBench-benchmark_results-pink :target: https://github.com/Minqi824/ADBench :alt: Benchmark
**PyOD ist agent-ready.** Claude Code und Codex können den ``od-expert``-Skill nutzen, um ADEngine-Untersuchungen zu steuern, während MCP-kompatible Agents die Detektor-Wissens- und Planungstools von PyOD abfragen können. Die klassische ``fit``/``predict``-API bleibt unverändert.
PyOD 3 ist die umfassendste Python-Bibliothek für Anomalieerkennung. Vier Säulen:
=========================== ========================================================================================
Säule Was sie bedeutet
=========================== ========================================================================================
Multi-Modal 61 Detektoren über tabellarische, Zeitreihen-, Graph-, Text-, Bild- und Audiodaten, eine API
Full Lifecycle Von Rohdaten bis zu erklärten Anomalien und Handlungsempfehlungen in einem einzigen Aufruf
Agentic od-expert verwandelt natürlichsprachliche Anfragen in ADEngine-Workflows; MCP stellt strukturierte Tools für andere Agents bereit
Most Used 46+ Millionen Downloads; benchmark-gestütztes Routing (ADBench, TSB-AD, BOND, NLP-ADBench)
=========================== ========================================================================================
Installation ^^^^^^^^^^^^
Kernbibliothek (erforderlich für jeden Aktivierungspfad):
.. code-block:: bash
pip install pyod
Wählen Sie dann den Aktivierungspfad, der zu Ihrem Agent-Stack passt:
.. code-block:: bash
# 1. Claude Code / Codex — enables the od-expert skill
pyod install skill # Claude Code: user-global (~/.claude/skills/)
pyod install skill --project # Codex: project-local (./skills/, Codex has no user-global dir)
# 2. Any MCP-compatible LLM — requires the optional mcp extra
pip install pyod[mcp]
pyod mcp serve # alias for `python -m pyod.mcp_server`
# 3. Pure Python — no extra step
# from pyod.utils.ad_engine import ADEngine
Führen Sie jederzeit pyod info aus, um Version, Detektor-Anzahlen und
den Installationsstatus jedes Aktivierungspfads zu sehen. pyod info erkennt
außerdem, welchen Agent-Stack Sie installiert haben (~/.claude/ für Claude Code,
~/.codex/ für Codex) und empfiehlt den passenden Installationsbefehl.
Für conda, Installation aus dem Quellcode, Abhängigkeitsdetails und Fehlerbehebung
siehe die vollständige Installationsanleitung <https://pyod.readthedocs.io/en/latest/install.html>__.
Der Legacy-Befehl pyod-install-skill aus v3.0.0 funktioniert weiterhin als
Alias für pyod install skill.
Outlier Detection mit 5 Zeilen Code (pip install pyod):
.. code-block:: python
from pyod.models.iforest import IForest
clf = IForest()
clf.fit(X_train)
y_train_scores = clf.decision_scores_ # training anomaly scores
y_test_scores = clf.decision_function(X_test) # test anomaly scores
Drei Möglichkeiten, PyOD zu verwenden:
========= ===================== ====================================================================== =======================================
Ebene Name Wann zu verwenden Einstiegspunkt
========= ===================== ====================================================================== =======================================
1 Classic API Sie wissen, welchen Detektor Sie wollen Layer 1 examples <https://pyod.readthedocs.io/en/latest/examples/tabular.html>__
2 ADEngine Sie möchten, dass PyOD automatisch auswählt, vergleicht und bewertet Layer 2 walkthrough <https://pyod.readthedocs.io/en/latest/examples/adengine.html>__
3 Agentic Investigation Sie möchten, dass ein KI-Agent OD durch natürliche Konversation steuert Layer 3 walkthrough <https://pyod.readthedocs.io/en/latest/examples/agentic.html>__
========= ===================== ====================================================================== =======================================
Die Ebenen 2 und 3 werden von ADEngine angetrieben, dem Lifecycle-Orchestrierungskern von PyOD. Der vollständige mehrstufige Layer-3-Untersuchungsablauf ist über den od-expert-Skill für Claude Code und Codex verfügbar. Der MCP-Server (python -m pyod.mcp_server) stellt zehn zustandslose Tools für MCP-kompatible LLMs bereit, die Wissensabfragen (list_detectors, explain_detector, compare_detectors, get_benchmarks), Planung (profile_data, plan_detection, build_detector) und Erkennung (run_detection, analyze_results, explain_findings) abdecken; zustandsbehaftete investigate / iterate MCP-Tools sind zurückgestellt.
.. image:: https://raw.githubusercontent.com/yzhao062/pyod/development/docs/figs/agentic-demo.png :alt: PyOD 3 agentic investigation demo on cardiotocography dataset :align: center :width: 720
Die obige Abbildung zeigt eine echte 5-stufige agentische Konversation auf dem UCI Cardiotocography-Datensatz. Siehe die vollständige Schritt-für-Schritt-Anleitung <https://pyod.readthedocs.io/en/latest/examples/agentic.html>, das ausführbare agentische Beispiel <https://github.com/yzhao062/pyod/blob/development/examples/agentic_example.py> oder die interaktive HTML-Demo <https://htmlpreview.github.io/?https://github.com/yzhao062/pyod/blob/development/examples/agentic_demo.html>__.