
.. image:: https://raw.githubusercontent.com/yzhao062/pyod/master/brand/pyod-icon.svg :target: https://pyod.dev :alt: PyOD エコシステム :width: 84px
PyOD 3: スケールするエージェント型異常検知
|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: ウェブサイト
.. |badge_pypi| image:: https://img.shields.io/pypi/v/pyod.svg?color=brightgreen :target: https://pypi.org/project/pyod/ :alt: PyPI バージョン
.. |badge_anaconda| image:: https://anaconda.org/conda-forge/pyod/badges/version.svg :target: https://anaconda.org/conda-forge/pyod :alt: Anaconda バージョン
.. |badge_docs| image:: https://readthedocs.org/projects/pyod/badge/?version=latest :target: https://pyod.readthedocs.io/en/latest/?badge=latest :alt: ドキュメントの状態
.. |badge_stars| image:: https://img.shields.io/github/stars/yzhao062/pyod.svg :target: https://github.com/yzhao062/pyod/stargazers :alt: GitHub スター
.. |badge_forks| image:: https://img.shields.io/github/forks/yzhao062/pyod.svg?color=blue :target: https://github.com/yzhao062/pyod/network :alt: GitHub フォーク
.. |badge_downloads| image:: https://pepy.tech/badge/pyod :target: https://pepy.tech/project/pyod :alt: ダウンロード
.. |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: テスト
.. |badge_coverage| image:: https://coveralls.io/repos/github/yzhao062/pyod/badge.svg :target: https://coveralls.io/github/yzhao062/pyod :alt: カバレッジ状況
.. |badge_maintainability| image:: https://api.codeclimate.com/v1/badges/bdc3d8d0454274c753c4/maintainability :target: https://codeclimate.com/github/yzhao062/Pyod/maintainability :alt: 保守性
.. |badge_license| image:: https://img.shields.io/github/license/yzhao062/pyod.svg :target: https://github.com/yzhao062/pyod/blob/master/LICENSE :alt: ライセンス
.. |badge_benchmark| image:: https://img.shields.io/badge/ADBench-benchmark_results-pink :target: https://github.com/Minqi824/ADBench :alt: ベンチマーク
**PyOD はエージェント対応です。** Claude Code と Codex は ``od-expert`` スキルを使用して ADEngine の調査を実行でき、MCP 互換エージェントは PyOD の検出器知識と計画ツールを照会できます。従来の ``fit``/``predict`` API は変更されていません。
PyOD 3 は、異常検知のための最も包括的な Python ライブラリです。4つの柱:
=========================== ========================================================================================
柱 内容
=========================== ========================================================================================
マルチモーダル 表、時系列、グラフ、テキスト、画像、音声 データに対応する61の検出器を、単一のAPIで提供
全ライフサイクル 生データから説明付きの異常と次のステップのガイダンスまでを単一の呼び出しで実現
エージェント型 od-expert は自然言語のリクエストを ADEngine ワークフローに変換します。MCP は他のエージェント向けに構造化ツールを公開します
最も利用されている 4,600万以上のダウンロード。ベンチマークに裏付けられたルーティング (ADBench, TSB-AD, BOND, NLP-ADBench)
=========================== ========================================================================================
インストール ^^^^^^^
コアライブラリ (すべてのアクティベーションパスに必要):
.. code-block:: bash
pip install pyod
次に、お使いのエージェントスタックに合ったアクティベーションパスを選択します:
.. 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
pyod info をいつでも実行すると、バージョン、検出器の数、各アクティベーションパスのインストール状態を確認できます。pyod info は、インストールされているエージェントスタック (Claude Code の場合は ~/.claude/、Codex の場合は ~/.codex/) も検出し、適切なインストールコマンドを推奨します。
conda、ソースからのインストール、依存関係の詳細、トラブルシューティングについては、完全な インストールガイド <https://pyod.readthedocs.io/en/latest/install.html>__ を参照してください。v3.0.0 の従来の pyod-install-skill コマンドは、pyod install skill のエイリアスとして引き続き機能します。
5行のコードで外れ値検出 (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
PyOD の3つの使用方法:
========= ===================== ====================================================================== =======================================
層 名前 使用する場面 エントリポイント
========= ===================== ====================================================================== =======================================
1 クラシックAPI 使用したい検出器が明確にわかっている場合 レイヤー1の例 <https://pyod.readthedocs.io/en/latest/examples/tabular.html>__
2 ADEngine PyOD に検出器の選択・比較・評価を自動的に任せたい場合 レイヤー2のチュートリアル <https://pyod.readthedocs.io/en/latest/examples/adengine.html>__
3 エージェント型調査 AI エージェントに自然な対話で異常検出 (OD) を進めてもらいたい場合 レイヤー3のチュートリアル <https://pyod.readthedocs.io/en/latest/examples/agentic.html>__
========= ===================== ====================================================================== =======================================
レイヤー2と3は、PyOD のライフサイクルオーケストレーションの核である ADEngine によって支えられています。マルチターンのレイヤー3調査フロー全体は、Claude Code と Codex 向けの od-expert スキルで利用できます。MCP サーバー (python -m pyod.mcp_server) は、MCP 互換 LLM 向けに10個のステートレスツールを公開しており、知識クエリ (list_detectors, explain_detector, compare_detectors, get_benchmarks)、プランニング (profile_data, plan_detection, build_detector)、検出 (run_detection, analyze_results, explain_findings) を網羅します。ステートフルな investigate / iterate MCP ツールは延期されます。
.. image:: https://raw.githubusercontent.com/yzhao062/pyod/development/docs/figs/agentic-demo.png :alt: PyOD 3 のエージェント型調査デモ(cardiotocography データセット) :align: center :width: 720
上の図は、UCI Cardiotocography データセットでの実際の5ターンのエージェント型対話を示しています。完全な ウォークスルー <https://pyod.readthedocs.io/en/latest/examples/agentic.html>、実行可能な エージェント型の例 <https://github.com/yzhao062/pyod/blob/development/examples/agentic_example.py>、またはインタラクティブな HTMLデモ <https://htmlpreview.github.io/?https://github.com/yzhao062/pyod/blob/development/examples/agentic_demo.html>__ を参照してください。
PyOD エコシステム & リソース:
NLP-ADBench <https://github.com/USC-FORTIS/NLP-ADBench>__ (NLP異常検知) | TODS <https://github.com/datamllab/tods>__ (時系列) | PyGOD <https://pygod.org/>__ (グラフ) | ADBench <https://github.com/Minqi824/ADBench>__ (ベンチマーク) | AD-LLM <https://arxiv.org/abs/2412.11142>__ (LLMベースの異常検知) [#Yang2024ad]_ | Resources <https://github.com/yzhao062/anomaly-detection-resources>__
About PyOD ^^^^^^^^^^
2017年に設立された PyOD は、異常検知のための最も長く使われ、最も広く利用されている Python ライブラリです。4,600万以上のダウンロード <https://pepy.tech/project/pyod>__ を誇り、学術研究(Analytics Vidhya <https://www.analyticsvidhya.com/blog/2019/02/outlier-detection-python-pyod/>、KDnuggets <https://www.kdnuggets.com/2019/02/outlier-detection-methods-cheat-sheet.html>、Towards Data Science <https://towardsdatascience.com/anomaly-detection-for-dummies-15f148e559c1>__ で紹介)と商用製品の両方に利用されています。
V3 は、従来の fit/predict API の完全な後方互換性を維持しながら、ADEngine (ライフサイクルオーケストレーション) と od-expert スキル (エージェント型ワークフロー) を追加してライブラリを拡張します。V3 は、高速な並列トレーニングのための SUOD [#Zhao2021SUOD]_ と、モデルごとの高速化のための numba JIT 上に構築されています。
インパクトと認知: