Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
pyod — 一个用于跨表格、时间序列、图、文本、图像和音频数据进行异常检测的 Python 库。提供 60+ 检测器、基准测试支撑的 ADEngine 编排,以及面向 AI 代理的智能体工作流。 | Kitploit
工具/GitHubGitHub/yzhao062/pyod
机器学习异常检测
GitHubyzhao062/pyod

pyod

一个用于跨表格、时间序列、图、文本、图像和音频数据进行异常检测的 Python 库。提供 60+ 检测器、基准测试支撑的 ADEngine 编排,以及面向 AI 代理的智能体工作流。

查看仓库网站
10.0k1.5k4天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

.. image:: https://raw.githubusercontent.com/yzhao062/pyod/master/brand/pyod-icon.svg :target: https://pyod.dev :alt: PyOD 生态系统 :width: 84px

Python 异常检测(PyOD)3

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: 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


root@kitploit:~
**PyOD 已为智能体做好准备。** Claude Code 和 Codex 可以使用 ``od-expert`` 技能来驱动 ADEngine 调查,而兼容 MCP 的智能体可以查询 PyOD 的检测器知识与规划工具。经典的 ``fit``/``predict`` API 保持不变。

PyOD 3 是功能最全面的 Python 异常检测库。四大支柱:

=========================== ======================================================================================== 支柱 含义 =========================== ======================================================================================== 多模态 跨表格、时间序列、图、文本、图像和音频数据的 61 个检测器,一个 API 全生命周期 从原始数据到可解释的异常及下一步行动建议,一次调用即可完成 智能体 od-expert 将自然语言请求转化为 ADEngine 工作流;MCP 为其他智能体提供结构化工具 使用最广泛 下载量超过 4600 万次;基于基准测试的路由(ADBench、TSB-AD、BOND、NLP-ADBench) =========================== ========================================================================================

安装 ^^^^^^^

核心库(每条激活路径都需要):

.. code-block:: bash

root@kitploit:~
pip install pyod

然后选择与你的智能体技术栈匹配的激活路径:

.. code-block:: bash

root@kitploit:~
# 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/ 对应 Claude Code,~/.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

root@kitploit:~
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 的三种方式:

========= ===================== ====================================================================== ======================================= 层级 名称 适用场景 入口 ========= ===================== ====================================================================== ======================================= 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 智能体通过自然对话驱动异常检测 第 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 提供十个无状态工具,涵盖知识查询(list_detectors、explain_detector、compare_detectors、get_benchmarks)、规划(profile_data、plan_detection、build_detector)和检测(run_detection、analyze_results、explain_findings);有状态的 investigate / 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]_ | 资源 <https://github.com/yzhao062/anomaly-detection-resources>


关于 PyOD ^^^^^^^^^^

PyOD 成立于 2017 年,是运行时间最长、使用最广泛的 Python 异常检测库。凭借 4600 万+ 次下载 <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 通过 ADEngine(生命周期编排)和 od-expert 技能(智能体工作流)扩展了该库,同时保持经典 fit/predict API 完全向后兼容。V3 基于 SUOD [#Zhao2021SUOD]_ 构建,以实现快速并行训练,并通过 numba JIT 为各模型加速。

影响力与认可:

=================================== =========================================================================== 领域 示例 =================================== =========================================================================== 航天与科学 欧洲航天局的 OPS-SAT 航天器遥测基准 <https://www.nature.com/articles/s41597-025-05035-3>(Nature Scientific Data,2025)使用 PyOD 执行全部 30 种算法。 企业部署 沃尔玛(每日 100 万+ 次定价更新,KDD 2019)、Databricks(将 PyOD 与 MLflow/Hyperopt 集成的 Kakapo 框架;内部威胁检测解决方案)、IQVIA(12.3 万+ 条药房理赔)、Altair AI Studio、爱立信(专利 WO2023166515A1 <https://patents.google.com/patent/WO2023166515A1>)。 书籍 Outlier Detection in Python <https://www.manning.com/books/outlier-detection-in-python>(Brett Kennedy,Manning);Handbook of Anomaly Detection with Python(Chris Kuo,Columbia);Finding Ghosts in Your Data <https://link.springer.com/book/10.1007/978-1-4842-8870-2>(Kevin Feasel,Apress)。 课程 DataCamp Anomaly Detection in Python <https://www.datacamp.com/courses/anomaly-detection-in-python>(平台学习者 1900 万+)、Manning liveProject <https://www.manning.com/liveproject/using-pyod-and-ensembles-methods>、O'Reilly 视频版、多个 Udemy 课程。 播客 Talk Python To Me #497 <https://talkpython.fm/episodes/show/497/outlier-detection-with-python>。 国际 提供 5 种非英语语言教程:中文(CSDN、知乎、搜狐、机器之心、__ 完整文档翻译)、日语、韩语、德语、西班牙语。 =================================== ===========================================================================

如需完整的引用文献、企业部署、专利和媒体报道列表,请参阅 Read the Docs 上的完整影响力页面 <https://pyod.readthedocs.io/en/latest/impact.html>__。

引用 PyOD:

如果您在科学出版物中使用 PyOD,我们将不胜感激您引用以下论文:

PyOD 2: A Python Library for Outlier Detection with LLM-powered Model Selection <https://arxiv.org/abs/2412.12154>__ 以预印本形式提供。如果您在科学出版物中使用 PyOD,我们恳请您引用以下论文::

root@kitploit:~
@inproceedings{chen2025pyod,
  title={Pyod 2: A python library for outlier detection with llm-powered model selection},
  author={Chen, Sihan and Qian, Zhuangzhuang and Siu, Wingchun and Hu, Xingcan and Li, Jiaqi and Li, Shawn and Qin, Yuehan and Yang, Tiankai and Xiao, Zhuo and Ye, Wanghao and others},
  booktitle={Companion Proceedings of the ACM on Web Conference 2025},
  pages={2807--2810},
  year={2025}
}

PyOD 论文 <http://www.jmlr.org/papers/volume20/19-011/19-011.pdf>__ 发表于 Journal of Machine Learning Research (JMLR) <http://www.jmlr.org/>__(MLOSS 专栏)。::

root@kitploit:~
@article{zhao2019pyod,
    author  = {Zhao, Yue and Nasrullah, Zain and Li, Zheng},
    title   = {PyOD: A Python Toolbox for Scalable Outlier Detection},
    journal = {Journal of Machine Learning Research},
    year    = {2019},
    volume  = {20},
    number  = {96},
    pages   = {1-7},
    url     = {http://jmlr.org/papers/v20/19-011.html}
}

或::

root@kitploit:~
Zhao, Y., Nasrullah, Z. and Li, Z., 2019. PyOD: A Python Toolbox for Scalable Outlier Detection. Journal of machine learning research (JMLR), 20(96), pp.1-7.

如需更全面的异常检测视角,请参阅我们在 NeurIPS 上发表的关于 ADBench <https://arxiv.org/abs/2206.09426>__ [#Han2022ADBench]_ 和 ADGym <https://arxiv.org/abs/2309.15376>__ 的论文。

目录:

  • API 速查表与参考 <#api-cheatsheet--reference>__
  • 基准测试 <#benchmarks>__
  • 已实现的算法 <#implemented-algorithms>__(表格、时间序列、图、嵌入)
  • 其他主题 <#additional-topics>__(模型保存/加载、SUOD、阈值化)
  • 异常检测快速入门 <#quick-start-for-outlier-detection>__
  • 如何贡献 <#how-to-contribute>__
  • 收录标准 <#inclusion-criteria>__

API 速查表与参考 ^^^^^^^^^^^^^^^^^^^^^^^^^^

完整的 API 参考按模态拆分,位于 PyOD 文档 <https://pyod.readthedocs.io/en/latest/>:表格 <https://pyod.readthedocs.io/en/latest/pyod.models.tabular.html>、时间序列 <https://pyod.readthedocs.io/en/latest/pyod.models.timeseries.html>、图 <https://pyod.readthedocs.io/en/latest/pyod.models.graph.html>、嵌入 <https://pyod.readthedocs.io/en/latest/pyod.models.embedding.html>、ADEngine <https://pyod.readthedocs.io/en/latest/pyod.ad_engine.html>、工具函数 <https://pyod.readthedocs.io/en/latest/pyod.utils.html>__。以下是所有检测器的快速速查表:

  • fit(X):拟合检测器。在无监督方法中,参数 y 会被忽略。
  • decision_function(X):使用已拟合的检测器预测 X 的原始异常分数。
  • predict(X):使用已拟合的检测器,以二元标签形式判断样本是否为异常。
  • predict_proba(X):使用已拟合的检测器,估算样本为异常的概率。
  • predict_confidence(X):逐样本评估模型的置信度(适用于 predict 和 predict_proba)[#Perini2020Quantifying]_。
  • predict_with_rejection(X)\ :允许检测器拒绝(即放弃做出)高度不确定的预测(输出 = -2)[#Perini2023Rejection]_。

已拟合模型的关键属性:

  • decision_scores_:训练数据的异常分数。分数越高通常表示行为越异常。异常值通常具有更高的分数。
  • labels_:训练数据的二元标签,其中 0 表示正常值,1 表示异常值/离群点。

基准测试 ^^^^^^^^^^

  • ADBench <https://github.com/Minqi824/ADBench>__ [#Han2022ADBench]_:57 个表格数据集上的 30 种算法。参见对比 <https://github.com/yzhao062/pyod/blob/master/examples/compare_all_models.py>__。
  • NLP-ADBench <https://github.com/USC-FORTIS/NLP-ADBench>__:8 个文本数据集上的 19 种方法。两步法(嵌入 + 检测器)优于端到端方法。
  • TSB-AD <https://github.com/TheDatumOrg/TSB-AD>__ [#Liu2024TSB]_:1070 个时间序列数据集上的 40 种算法(NeurIPS 2024)。
  • BOND <https://arxiv.org/abs/2206.10071>__ [#Liu2022BOND]_:14 个数据集上的 14 种图异常检测算法(NeurIPS 2022)。

其他主题 ^^^^^^^^^

  • 模型保存与加载 <https://pyod.readthedocs.io/en/latest/model_persistence.html>:使用 joblib 或 pickle 保存和加载 PyOD 模型。参见示例 <https://github.com/yzhao062/pyod/blob/master/examples/save_load_model_example.py>。
  • 使用 SUOD 快速训练 <https://pyod.readthedocs.io/en/latest/fast_train.html>:利用 SUOD 框架 [#Zhao2021SUOD]_ 加速训练与预测。参见示例 <https://github.com/yzhao062/pyod/blob/master/examples/suod_example.py>。
  • 异常分数阈值化 <https://pyod.readthedocs.io/en/latest/thresholding.html>:通过 PyThresh <https://github.com/KulikDM/pythresh> 以数据驱动的方式设置污染率水平。

已实现的算法 ^^^^^^^^^^^^^^

PyOD 分为两个功能组:(i)检测算法,针对表格、时间序列、图与音频数据设有专门的小节(表格表中的 EmbeddingOD 通过基础模型编码器增加了对文本和图像的支持);以及**(ii)工具函数**,用于数据生成、评估与生命周期编排。

(i-a)表格与多模态检测算法:

.. list-table:: :widths: 15 14 58 5 8 :header-rows: 1* - 类型 - 缩写 - 算法 - 年份 - 引用

    • 概率型
    • ECOD
    • 使用经验累积分布函数的无监督异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ecod_example.py>__)
    • 2022
    • [#Li2021ECOD]_
    • 概率型
    • ABOD
    • 基于角度的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/abod_example.py>__)
    • 2008
    • [#Kriegel2008Angle]_
    • 概率型
    • FastABOD
    • 使用近似的快速基于角度的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/abod_example.py>__)
    • 2008
    • [#Kriegel2008Angle]_
    • 概率型
    • COPOD
    • COPOD: 基于 Copula 的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/copod_example.py>__)
    • 2020
    • [#Li2020COPOD]_
    • 概率型
    • MAD
    • 中位数绝对偏差 (MAD) (示例 <https://github.com/yzhao062/pyod/blob/development/examples/mad_example.py>__)
    • 1993
    • [#Iglewicz1993How]_
    • 概率型
    • SOS
    • 随机异常选择 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/sos_example.py>__)

集成方法(IForest、INNE、DIF、FB、LSCP、LODA、SUOD、XGBOD)已包含在上表中。分数组合函数(平均值、最大化、AOM、MOA、中位数、多数投票)位于 pyod.models.combination 中。有关详细信息,请参阅 API 文档 <https://pyod.readthedocs.io/en/latest/pyod.models.tabular.html>__。

(i-b) 时间序列异常检测 :

所有时间序列检测器都使用与表格检测器相同的 fit/predict/decision_function API,但有一个例外:MatrixProfile 是转导式的(仅训练;在 fit() 后使用 decision_scores_ 和 labels_,没有样本外 predict)。

输入格式:单变量为形状 (n_timestamps,) 的 numpy 数组,多变量为 (n_timestamps, n_channels)。每行是一个时间步;列是通道/特征。Pandas DataFrame 和列表会自动转换。输出:形状为 (n_timestamps,) 的 decision_scores_,每个时间步对应一个异常分数。

3 行代码实现时间序列检测:

.. code-block:: python

root@kitploit:~
from pyod.models.ts_kshape import KShape      # or any TS detector
clf = KShape(window_size=20)
clf.fit(X_train)                               # shape (n_timestamps,) or (n_timestamps, n_channels)
scores = clf.decision_scores_                  # per-timestamp anomaly scores

算法排名来自 TSB-AD 基准 <https://github.com/TheDatumOrg/TSB-AD>__ [#Liu2024TSB]_ (NeurIPS 2024, 1070 个数据集):

.. list-table:: :widths: 15 18 50 5 12 :header-rows: 1

    • 类型
    • 缩写
    • 算法
    • 年份
    • 引用
    • 窗口化桥接
    • TimeSeriesOD
    • 滑动窗口上的任意 PyOD 检测器 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ts_od_example.py>__)
    • 2026
    • 子序列
    • MatrixProfile
    • 通过 STOMP 的矩阵轮廓,转导式 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ts_matrix_profile_example.py>__)
    • 2016
    • [#Yeh2016Matrix]_
    • 频域
    • SpectralResidual
    • 频谱残差: 基于 FFT 的显著性 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ts_spectral_residual_example.py>__)
    • 2019
    • [#Ren2019Time]_
    • 聚类
    • KShape
    • k-Shape 聚类 (在 TSB-AD 中排名第 2) (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ts_kshape_example.py>__)
    • 2015
    • [#Paparrizos2015KShape]_
    • 流式
    • SAND
    • 具有漂移适应的流式处理,实验性 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ts_sand_example.py>__)
    • 2021
    • [#Boniol2021SAND]_
    • 深度学习
    • LSTMAD
    • LSTM 预测误差 + 马氏距离评分
    • 2015
    • [#Malhotra2015Long]_

(i-c) 图异常检测 (pip install pyod[graph]):

在 v1 中,所有图检测器都是转导式的:在 fit() 后使用 decision_scores_ 和 labels_。没有样本外 predict。输入:包含 x(节点特征)和 edge_index(COO 边)的 PyG Data 对象。SCAN 无需特征即可工作。

3 行代码实现图检测 (pip install pyod[graph]):

.. code-block:: python

root@kitploit:~
from pyod.models.pyg_dominant import DOMINANT
clf = DOMINANT(hidden_dim=64, epochs=100)
clf.fit(data)                                  # PyG Data object
scores = clf.decision_scores_                  # per-node anomaly scores

算法排名来自 BOND 基准 <https://arxiv.org/abs/2206.10071>__ [#Liu2022BOND]_ (NeurIPS 2022, 14 个数据集):

.. list-table:: :widths: 18 18 45 5 14 :header-rows: 1

    • 类型
    • 缩写
    • 算法
    • 年份
    • 引用
    • GCN 自编码器
    • DOMINANT
    • GCN 自编码器,结构 + 属性重构 (在 BOND 深度方法中排名第 1) (dominant 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_dominant_example.py>__)
    • 2019
    • [#Ding2019DOMINANT]_
    • 对比学习
    • CoLA
    • 对比自监督,局部邻居上下文 (在 BOND 深度方法中排名第 2) (cola 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_cola_example.py>__)
    • 2022
    • [#Liu2022CoLA]_
    • 对比学习+AE
    • CONAD
    • 带有异常视角注入 + 双重重构的对比学习 (conad 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_conad_example.py>__)
    • 2022
    • [#Xu2022CONAD]_
    • 注意力自编码器
    • AnomalyDAE
    • GAT 结构编码器 + MLP 属性编码器 (anomalydae 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_anomalydae_example.py>__)
    • 2020
    • [#Fan2020AnomalyDAE]_
    • 模体自编码器
    • GUIDE
    • 在原始 + 三角形模体邻接上的双 GCN 自编码器 (guide 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_guide_example.py>__)
    • 2021
    • [#Yuan2021GUIDE]_
    • 矩阵分解

(i-d) 音频异常检测 (pip install pyod[audio]):

音频片段使用相同的 fit/decision_function API。提供两条路径:轻量级的“先嵌入后检测”路径(EmbeddingOD.for_audio() 将每个片段转换为 74 维手工声学特征向量,并运行任意经典检测器),以及专用的深度检测器(AudioAE,一个 log-mel 重构自编码器)。输入为文件路径、波形数组或 (waveform, sample_rate) 元组。输出:每个片段一个异常分数。

3 行代码实现音频检测 (pip install pyod[audio]):

.. code-block:: python

root@kitploit:~
from pyod.models.embedding import EmbeddingOD
clf = EmbeddingOD.for_audio('balanced')        # 74-dim handcrafted features + KNN
clf.fit(train_clips)                            # list of file paths or waveform arrays
scores = clf.decision_scores_                  # per-clip anomaly scores

.. list-table:: :widths: 18 18 45 5 14 :header-rows: 1

    • 类型
    • 缩写
    • 算法
    • 年份
    • 引用
    • 先嵌入后检测
    • EmbeddingOD
    • for_audio(): 74 维 MFCC、chroma 和频谱特征,可与任意检测器配合使用
    • 2026
    • 深度 AE
    • AudioAE
    • Log-mel 重构自编码器 (DCASE 2020 任务 2 基线)
    • 2020

(ii) 实用函数:=================== ============================ ===================================================================================================================================================== 类型 名称 功能 =================== ============================ ===================================================================================================================================================== 数据 generate_data 合成数据生成;正常数据来自多元高斯分布,异常值来自均匀分布 数据 generate_data_clusters 分簇的合成数据生成,用于更复杂的模式 评估 evaluate_print 打印检测器的 ROC-AUC 和 Precision @ Rank n 评估 precision_n_scores 计算 Precision @ Rank n 工具 get_label_n 将原始异常值得分转换为二元标签,将前 n 个最高分标记为 1 统计 wpearsonr 计算两个样本的加权 Pearson 相关系数 编码 resolve_encoder 从字符串名称、BaseEncoder 实例或可调用对象解析编码器 编码 SentenceTransformerEncoder 通过 sentence-transformers 模型(例如 MiniLM、mpnet)编码文本 编码 OpenAIEncoder 通过 OpenAI Embeddings API(text-embedding-3-small/large)编码文本 编码 HuggingFaceEncoder 通过 HuggingFace transformers(BERT、DINOv2、CLIP)编码文本或图像 =================== ============================ =====================================================================================================================================================


异常检测快速入门 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

PyOD 已获得机器学习社区的广泛认可,并有多篇专题文章和教程。

Analytics Vidhya:使用 PyOD 库在 Python 中学习异常检测的精彩教程 <https://www.analyticsvidhya.com/blog/2019/02/outlier-detection-python-pyod/>__

KDnuggets:异常检测方法的直观可视化 <https://www.kdnuggets.com/2019/02/outlier-detection-methods-cheat-sheet.html>、来自 PyOD 的异常检测方法概述 <https://www.kdnuggets.com/2019/06/overview-outlier-detection-methods-pyod.html>

Towards Data Science:异常检测入门指南 <https://towardsdatascience.com/anomaly-detection-for-dummies-15f148e559c1>__

"examples/knn_example.py" <https://github.com/yzhao062/pyod/blob/master/examples/knn_example.py>__ 演示了使用 kNN 检测器的基本 API。需要注意的是,所有其他算法的 API 都是一致/相似的。

有关运行示例的更详细说明,请参阅 examples 目录 <https://github.com/yzhao062/pyod/blob/master/examples>__。

#. 初始化一个 kNN 检测器,拟合模型,并进行预测。

.. code-block:: python

root@kitploit:~
   from pyod.models.knn import KNN   # kNN detector
   from pyod.utils.data import generate_data

   contamination = 0.1  # percentage of outliers
   n_train = 200  # number of training points
   n_test = 100  # number of testing points

   # generate sample data
   X_train, X_test, y_train, y_test = generate_data(
       n_train=n_train, n_test=n_test, n_features=2,
       contamination=contamination, random_state=42)

   # train kNN detector
   clf_name = 'KNN'
   clf = KNN()
   clf.fit(X_train)

   # get the prediction label and outlier scores of the training data
   y_train_pred = clf.labels_  # binary labels (0: inliers, 1: outliers)
   y_train_scores = clf.decision_scores_  # raw outlier scores

   # get the prediction on the test data
   y_test_pred = clf.predict(X_test)  # outlier labels (0 or 1)
   y_test_scores = clf.decision_function(X_test)  # outlier scores

   # it is possible to get the prediction confidence as well
   y_test_pred, y_test_pred_confidence = clf.predict(X_test, return_confidence=True)  # outlier labels (0 or 1) and confidence in the range of [0,1]

#. 通过 ROC 和 Precision @ Rank n (p@n) 评估预测结果。

.. code-block:: python

root@kitploit:~
   from pyod.utils.data import evaluate_print
   
   # evaluate and print the results
   print("\nOn Training Data:")
   evaluate_print(clf_name, y_train, y_train_scores)
   print("\nOn Test Data:")
   evaluate_print(clf_name, y_test, y_test_scores)

#. 查看示例输出与可视化结果。

.. code-block:: python

root@kitploit:~
   On Training Data:
   KNN ROC:0.9992, precision @ rank n:0.95

   On Test Data:
   KNN ROC:1.0, precision @ rank n:1.0

.. code-block:: python

root@kitploit:~
   from pyod.utils.example import visualize

   visualize(clf_name, X_train, y_train, X_test, y_test, y_train_pred,
       y_test_pred, show_figure=True, save_figure=False)

致谢 ^^^^^^^^^^^^^^^

本材料基于美国国家科学基金会(National Science Foundation)资助的工作, 奖项编号 2346158 <https://www.nsf.gov/awardsearch/showAward?AWD_ID=2346158>_, 用于"NSF POSE:第二阶段:OpenAD:一个集成的开源异常检测生态系统"。 该奖项将伊利诺伊大学芝加哥分校列为主导机构, 伊利诺伊理工学院、理海大学和南加州大学列为次级受奖机构。

本材料中表达的任何观点、发现、结论或建议均为作者(们)的观点, 并不一定反映美国国家科学基金会的意见。


参考文献 ^^^^^^^^^

.. [#Aggarwal2015Outlier] Aggarwal, C.C., 2015. Outlier analysis. In Data mining (pp. 237-263). Springer, Cham.

.. [#Aggarwal2015Theoretical] Aggarwal, C.C. and Sathe, S., 2015. Theoretical foundations and algorithms for outlier ensembles.\ ACM SIGKDD Explorations Newsletter\ , 17(1), pp.24-47.

.. [#Aggarwal2017Outlier] Aggarwal, C.C. and Sathe, S., 2017. Outlier ensembles: An introduction. Springer.

.. [#Almardeny2020A] Almardeny, Y., Boujnah, N. and Cleary, F., 2020. A Novel Outlier Detection Method for Multivariate Data. IEEE Transactions on Knowledge and Data Engineering.

.. [#Angiulli2002Fast] Angiulli, F. and Pizzuti, C., 2002, August. Fast outlier detection in high dimensional spaces. In European Conference on Principles of Data Mining and Knowledge Discovery pp. 15-27.

.. [#Arning1996A] Arning, A., Agrawal, R. and Raghavan, P., 1996, August. A Linear Method for Deviation Detection in Large Databases. In KDD (Vol. 1141, No. 50, pp. 972-981).

.. [#Bandaragoda2018Isolation] Bandaragoda, T. R., Ting, K. M., Albrecht, D., Liu, F. T., Zhu, Y., and Wells, J. R., 2018, Isolation-based anomaly detection using nearest-neighbor ensembles. Computational Intelligence\ , 34(4), pp. 968-998.

.. [#Breunig2000LOF] Breunig, M.M., Kriegel, H.P., Ng, R.T. and Sander, J., 2000, May. LOF: identifying density-based local outliers. ACM Sigmod Record\ , 29(2), pp. 93-104.

.. [#Burgess2018Understanding] Burgess, Christopher P., et al. "Understanding disentangling in beta-VAE." arXiv preprint arXiv:1804.03599 (2018).

.. [#Campello2013Density] Campello, R.J.G.B., Moulavi, D. and Sander, J., 2013, April. Density-based clustering based on hierarchical density estimates. In Pacific-Asia Conference on Knowledge Discovery and Data Mining (pp. 160-172). Springer.

.. [#Cook1977Detection] Cook, R.D., 1977. Detection of influential observation in linear regression. Technometrics, 19(1), pp.15-18.

.. [#Chen2024PyOD] Chen, S., Qian, Z., Siu, W., Hu, X., Li, J., Li, S., Qin, Y., Yang, T., Xiao, Z., Ye, W. and Zhang, Y., 2024. PyOD 2: A Python Library for Outlier Detection with LLM-powered Model Selection. arXiv preprint arXiv:2412.12154.

.. [#Fang2001Wrap] Fang, K.T. and Ma, C.X., 2001. Wrap-around L2-discrepancy of random sampling, Latin hypercube and uniform designs. Journal of complexity, 17(4), pp.608-624.

.. [#Goldstein2012Histogram] Goldstein, M. and Dengel, A., 2012. Histogram-based outlier score (hbos): A fast unsupervised anomaly detection algorithm. In KI-2012: Poster and Demo Track\ , pp.59-63.

.. [#Goodge2022Lunar] Goodge, A., Hooi, B., Ng, S.K. and Ng, W.S., 2022, June. Lunar: Unifying local outlier detection methods via graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence.

.. [#Gopalan2019PIDForest] Gopalan, P., Sharan, V. and Wieder, U., 2019. PIDForest: Anomaly Detection via Partial Identification. In Advances in Neural Information Processing Systems, pp. 15783-15793.

.. [#Han2022ADBench] Han, S., Hu, X., Huang, H., Jiang, M. and Zhao, Y., 2022. ADBench: Anomaly Detection Benchmark. arXiv preprint arXiv:2206.09426.

.. [#Hardin2004Outlier] Hardin, J. and Rocke, D.M., 2004. Outlier detection in the multiple cluster setting using the minimum covariance determinant estimator. Computational Statistics & Data Analysis\ , 44(4), pp.625-638.

.. [#He2003Discovering] He, Z., Xu, X. and Deng, S., 2003. Discovering cluster-based local outliers. Pattern Recognition Letters\ , 24(9-10), pp.1641-1650.

.. [#Hoffmann2007Kernel] Hoffmann, H., 2007. Kernel PCA for novelty detection. Pattern recognition, 40(3), pp.863-874.

.. [#Iglewicz1993How] Iglewicz, B. and Hoaglin, D.C., 1993. How to detect and handle outliers (Vol. 16). Asq Press.

.. [#Janssens2012Stochastic] Janssens, J.H.M., Huszár, F., Postma, E.O. and van den Herik, H.J., 2012. Stochastic outlier selection. Technical report TiCC TR 2012-001, Tilburg University, Tilburg Center for Cognition and Communication, Tilburg, The Netherlands.

.. [#Kingma2013Auto] Kingma, D.P. and Welling, M., 2013. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114.

.. [#Kriegel2008Angle] Kriegel, H.P. and Zimek, A., 2008, August. Angle-based outlier detection in high-dimensional data. In KDD '08\ , pp. 444-452. ACM.

.. [#Kriegel2009Outlier] Kriegel, H.P., Kröger, P., Schubert, E. and Zimek, A., 2009, April. Outlier detection in axis-parallel subspaces of high dimensional data. In Pacific-Asia Conference on Knowledge Discovery and Data Mining\ , pp. 831-838. Springer, Berlin, Heidelberg.

.. [#Latecki2007Outlier] Latecki, L.J., Lazarevic, A. and Pokrajac, D., 2007, July. Outlier detection with kernel density functions. In International Workshop on Machine Learning and Data Mining in Pattern Recognition (pp. 61-75). Springer, Berlin, Heidelberg.

.. [#Lazarevic2005Feature] Lazarevic, A. and Kumar, V., 2005, August. Feature bagging for outlier detection. In KDD '05. 2005.

.. [#Li2024NLPADBench] Li, Y., Li, J., Xiao, Z., Yang, T., Nian, Y., Hu, X. and Zhao, Y., 2025. NLP-ADBench: NLP Anomaly Detection Benchmark. In Findings of the Association for Computational Linguistics: EMNLP 2025.

.. [#Li2019MADGAN] Li, D., Chen, D., Jin, B., Shi, L., Goh, J. and Ng, S.K., 2019, September. MAD-GAN: Multivariate anomaly detection for time series data with generative adversarial networks. In International Conference on Artificial Neural Networks (pp. 703-716). Springer, Cham.

.. [#Li2020COPOD] Li, Z., Zhao, Y., Botta, N., Ionescu, C. and Hu, X. COPOD: Copula-Based Outlier Detection. IEEE International Conference on Data Mining (ICDM), 2020.

.. [#Li2021ECOD] Li, Z., Zhao, Y., Hu, X., Botta, N., Ionescu, C. and Chen, H. G. ECOD: Unsupervised Outlier Detection Using Empirical Cumulative Distribution Functions. IEEE Transactions on Knowledge and Data Engineering (TKDE), 2022.

.. [#Liu2008Isolation] Liu, F.T., Ting, K.M. and Zhou, Z.H., 2008, December. Isolation forest. In International Conference on Data Mining\ , pp. 413-422. IEEE.

.. [#Liu2019Generative] Liu, Y., Li, Z., Zhou, C., Jiang, Y., Sun, J., Wang, M. and He, X., 2019. Generative adversarial active learning for unsupervised outlier detection. IEEE Transactions on Knowledge and Data Engineering.

.. [#Nguyen2019scalable] Nguyen, M.N. and Vien, N.A., 2019. Scalable and interpretable one-class svms with deep learning and random fourier features. In Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD, 2018.

.. [#Pang2019Deep] Pang, Guansong, Chunhua Shen, and Anton Van Den Hengel. "Deep anomaly detection with deviation networks." In KDD, pp. 353-362. 2019.

.. [#Papadimitriou2003LOCI] Papadimitriou, S., Kitagawa, H., Gibbons, P.B. and Faloutsos, C., 2003, March. LOCI: Fast outlier detection using the local correlation integral. In ICDE '03, pp. 315-326. IEEE.

.. [#Pevny2016Loda] Pevný, T., 2016. Loda: Lightweight on-line detector of anomalies. Machine Learning, 102(2), pp.275-304.

.. [#Perini2020Quantifying] Perini, L., Vercruyssen, V., Davis, J. Quantifying the confidence of anomaly detectors in their example-wise predictions. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases (ECML-PKDD), 2020.

.. [#Perini2023Rejection] Perini, L., Davis, J. Unsupervised anomaly detection with rejection. In Proceedings of the Thirty-Seven Conference on Neural Information Processing Systems (NeurIPS), 2023.

.. [#Ramaswamy2000Efficient] Ramaswamy, S., Rastogi, R. and Shim, K., 2000, May. Efficient algorithms for mining outliers from large data sets. ACM Sigmod Record\ , 29(2), pp. 427-438.

.. [#Rousseeuw1999A] Rousseeuw, P.J. and Driessen, K.V., 1999. A fast algorithm for the minimum covariance determinant estimator. Technometrics\ , 41(3), pp.212-223.

.. [#Ruff2018Deep] Ruff, L., Vandermeulen, R., Goernitz, N., Deecke, L., Siddiqui, S.A., Binder, A., Müller, E. and Kloft, M., 2018, July. Deep one-class classification. In International conference on machine learning (pp. 4393-4402). PMLR.

.. [#Schlegl2017Unsupervised] Schlegl, T., Seeböck, P., Waldstein, S.M., Schmidt-Erfurth, U. and Langs, G., 2017, June. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International conference on information processing in medical imaging (pp. 146-157). Springer, Cham.

.. [#Scholkopf2001Estimating] Scholkopf, B., Platt, J.C., Shawe-Taylor, J., Smola, A.J. and Williamson, R.C., 2001. Estimating the support of a high-dimensional distribution. Neural Computation, 13(7), pp.1443-1471.

.. [#Shyu2003A] Shyu, M.L., Chen, S.C., Sarinnapakorn, K. and Chang, L., 2003. A novel anomaly detection scheme based on principal component classifier. MIAMI UNIV CORAL GABLES FL DEPT OF ELECTRICAL AND COMPUTER ENGINEERING.

.. [#Sugiyama2013Rapid] Sugiyama, M. and Borgwardt, K., 2013. Rapid distance-based outlier detection via sampling. Advances in neural information processing systems, 26.

.. [#Tang2002Enhancing] Tang, J., Chen, Z., Fu, A.W.C. and Cheung, D.W., 2002, May. Enhancing effectiveness of outlier detections for low density patterns. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp. 535-548. Springer, Berlin, Heidelberg.

.. [#Wang2020adVAE] Wang, X., Du, Y., Lin, S., Cui, P., Shen, Y. and Yang, Y., 2019. adVAE: A self-adversarial variational autoencoder with Gaussian anomaly prior knowledge for anomaly detection. Knowledge-Based Systems.

.. [#Xu2023Deep] Xu, H., Pang, G., Wang, Y., Wang, Y., 2023. Deep isolation forest for anomaly detection. IEEE Transactions on Knowledge and Data Engineering.

.. [#Yang2024ad] Yang, T., Nian, Y., Li, S., Xu, R., Li, Y., Li, J., Xiao, Z., Hu, X., Rossi, R., Ding, K. and Hu, X., 2024. AD-LLM: Benchmarking Large Language Models for Anomaly Detection. arXiv preprint arXiv:2412.11142.

.. [#You2017Provable] You, C., Robinson, D.P. and Vidal, R., 2017. Provable self-representation based outlier detection in a union of subspaces. In Proceedings of the IEEE conference on computer vision and pattern recognition.

.. [#Zenati2018Adversarially] Zenati, H., Romain, M., Foo, C.S., Lecouat, B. and Chandrasekhar, V., 2018, November. Adversarially learned anomaly detection. In 2018 IEEE International conference on data mining (ICDM) (pp. 727-736). IEEE.

.. [#Zhao2018XGBOD] Zhao, Y. and Hryniewicki, M.K. XGBOD: Improving Supervised Outlier Detection with Unsupervised Representation Learning. IEEE International Joint Conference on Neural Networks\ , 2018.

.. [#Zhao2019LSCP] Zhao, Y., Nasrullah, Z., Hryniewicki, M.K. and Li, Z., 2019, May. LSCP: Locally selective combination in parallel outlier ensembles. In Proceedings of the 2019 SIAM International Conference on Data Mining (SDM), pp. 585-593. Society for Industrial and Applied Mathematics.

.. [#Zhao2021SUOD] Zhao, Y., Hu, X., Cheng, C., Wang, C., Wan, C., Wang, W., Yang, J., Bai, H., Li, Z., Xiao, C., Wang, Y., Qiao, Z., Sun, J. and Akoglu, L. (2021). SUOD: Accelerating Large-scale Unsupervised Heterogeneous Outlier Detection. Conference on Machine Learning and Systems (MLSys).

.. [#Boniol2021SAND] Boniol, P., Paparrizos, J., Palpanas, T. and Franklin, M.J., 2021. SAND: Streaming Subsequence Anomaly Detection. Proceedings of the VLDB Endowment, 14(10), pp.1717-1729.

.. [#Malhotra2015Long] Malhotra, P., Vig, L., Shroff, G. and Agarwal, P., 2015. Long Short Term Memory Networks for Anomaly Detection in Time Series. In European Symposium on Artificial Neural Networks (ESANN).

.. [#Paparrizos2015KShape] Paparrizos, J. and Gravano, L., 2015. k-Shape: Efficient and Accurate Clustering of Time Series. In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, pp.1855-1870.

.. [#Ren2019Time] Ren, H., Xu, B., Wang, Y., Yi, C., Huang, C., Kou, X., Xing, T., Yang, M., Tong, J. and Zhang, Q., 2019. Time-Series Anomaly Detection Service at Microsoft. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp.3009-3017.

.. [#Xu2022Anomaly] Xu, J., Wu, H., Wang, J. and Long, M., 2022. Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy. In International Conference on Learning Representations (ICLR).

.. [#Yeh2016Matrix] Yeh, C.C.M., Zhu, Y., Ulanova, L., Begum, N., Ding, Y., Dau, H.A., Silva, D.F., Mueen, A. and Keogh, E., 2016. Matrix Profile I: All Pairs Similarity Joins for Time Series Subsequences. In 2016 IEEE 16th International Conference on Data Mining (ICDM), pp.1317-1322.

.. [#Ding2019DOMINANT] Ding, K., Li, J., Bhanushali, R. and Liu, H., 2019. Deep Anomaly Detection on Attributed Networks. In Proceedings of the 2019 SIAM International Conference on Data Mining, pp.594-602. SIAM.

.. [#Liu2022CoLA] Liu, Y., Li, Z., Pan, S., Gool, T., Xiang, T. and Gong, B., 2022. Anomaly Detection on Attributed Networks via Contrastive Self-Supervised Learning. In Proceedings of the ACM Web Conference 2022, pp.2137-2147.

.. [#Xu2022CONAD] Xu, Z., Huang, X., Zhao, Y., Dong, Y. and Li, J., 2022. Contrastive Attributed Network Anomaly Detection with Data Augmentation. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp.444-457. Springer.

.. [#Fan2020AnomalyDAE] Fan, H., Zhang, F. and Li, Z., 2020. AnomalyDAE: Dual Autoencoder for Anomaly Detection on Attributed Networks. In Proceedings of the 29th ACM International Conference on Information and Knowledge Management, pp.747-756.

.. [#Yuan2021GUIDE] Yuan, X., Zhou, N., Yu, S., Huang, H., Chen, Z. and Xia, F., 2021. Higher-Order Structure Based Anomaly Detection on Attributed Networks. In 2021 IEEE International Conference on Big Data, pp.2691-2700. IEEE... [#Li2017Radar] Li, J., Dani, H., Hu, X. and Liu, H., 2017. Radar: Residual Analysis for Anomaly Detection in Attributed Networks. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, pp.2152-2158.

.. [#Peng2018ANOMALOUS] Peng, Z., Luo, M., Li, J., Liu, H. and Zheng, Q., 2018. ANOMALOUS: A Joint Modeling Approach for Anomaly Detection on Attributed Networks. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, pp.3529-3535.

.. [#Xu2007SCAN] Xu, X., Yuruk, N., Feng, Z. and Schweiger, T.A.J., 2007. SCAN: A Structural Clustering Algorithm for Networks. In Proceedings of the 13th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp.824-833.

.. [#Liu2024TSB] Liu, Q., Boniol, P., Palpanas, T. and Paparrizos, J., 2024. TSB-AD: Towards A Reliable Time-Series Anomaly Detection Benchmark. In Advances in Neural Information Processing Systems (NeurIPS).

.. [#Liu2022BOND] Liu, K., Dou, Y., Zhao, Y., Ding, X., Hu, X., Zhang, R., Ding, K., Chen, C., Peng, H., Shu, K., Sun, L., Li, J., Chen, G.H., Jia, Z. and Yu, P.S., 2022. BOND: Benchmarking Unsupervised Outlier Node Detection on Static Attributed Graphs. In Advances in Neural Information Processing Systems (NeurIPS).

下载工具
iterate
、Real Python Podcast #208 <https://realpython.com/podcasts/rpp/208/>
aidoczh.com <https://www.aidoczh.com>
  • 2012
  • [#Janssens2012Stochastic]_
    • 概率型
    • QMCD
    • 准蒙特卡洛差异异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/qmcd_example.py>__)
    • 2001
    • [#Fang2001Wrap]_
    • 概率型
    • KDE
    • 基于核密度函数的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/kde_example.py>__)
    • 2007
    • [#Latecki2007Outlier]_
    • 概率型
    • Sampling
    • 通过采样进行快速基于距离的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/sampling_example.py>__)
    • 2013
    • [#Sugiyama2013Rapid]_
    • 概率型
    • GMM
    • 用于异常分析的概率混合建模 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/gmm_example.py>__)
    • [#Aggarwal2015Outlier]_ [Ch.2]
    • 线性模型
    • PCA
    • 主成分分析(到特征向量超平面的加权投影距离之和)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/pca_example.py>__)
    • 2003
    • [#Shyu2003A]_
    • 线性模型
    • KPCA
    • 核主成分分析 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/kpca_example.py>__)
    • 2007
    • [#Hoffmann2007Kernel]_
    • 线性模型
    • MCD
    • 最小协方差行列式(以马氏距离作为异常分数)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/mcd_example.py>__)
    • 1999
    • [#Hardin2004Outlier]_ [#Rousseeuw1999A]_
    • 线性模型
    • CD
    • 用于异常检测的库克距离 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/cd_example.py>__)
    • 1977
    • [#Cook1977Detection]_
    • 线性模型
    • OCSVM
    • 一类支持向量机 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ocsvm_example.py>__)
    • 2001
    • [#Scholkopf2001Estimating]_
    • 线性模型
    • LMDD
    • 基于偏差的异常检测 (LMDD) (示例 <https://github.com/yzhao062/pyod/blob/development/examples/lmdd_example.py>__)
    • 1996
    • [#Arning1996A]_
    • 基于邻近度
    • LOF
    • 局部异常因子 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/lof_example.py>__)
    • 2000
    • [#Breunig2000LOF]_
    • 基于邻近度
    • COF
    • 基于连通性的异常因子 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/cof_example.py>__)
    • 2002
    • [#Tang2002Enhancing]_
    • 基于邻近度
    • (Incr.) COF
    • 内存高效的基于连通性的异常因子(较慢,存储占用更少)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/cof_example.py>__)
    • 2002
    • [#Tang2002Enhancing]_
    • 基于邻近度
    • CBLOF
    • 基于聚类的局部异常因子 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/cblof_example.py>__)
    • 2003
    • [#He2003Discovering]_
    • 基于邻近度
    • LOCI
    • LOCI: 通过局部相关积分进行快速异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/loci_example.py>__)
    • 2003
    • [#Papadimitriou2003LOCI]_
    • 基于邻近度
    • HBOS
    • 基于直方图的异常分数 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/hbos_example.py>__)
    • 2012
    • [#Goldstein2012Histogram]_
    • 基于邻近度
    • HDBSCAN
    • 通过层次密度估计进行基于密度的聚类 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/hdbscan_example.py>__)
    • 2013
    • [#Campello2013Density]_
    • 基于邻近度
    • kNN
    • k 最近邻(到第 k 个邻居的距离作为异常分数)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/knn_example.py>__)
    • 2000
    • [#Ramaswamy2000Efficient]_
    • 基于邻近度
    • AvgKNN
    • 平均 kNN(到 k 个邻居的平均距离作为异常分数)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/knn_example.py>__)
    • 2002
    • [#Angiulli2002Fast]_
    • 基于邻近度
    • MedKNN
    • 中位数 kNN(到 k 个邻居的中位数距离作为异常分数)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/knn_example.py>__)
    • 2002
    • [#Angiulli2002Fast]_
    • 基于邻近度
    • SOD
    • 子空间异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/sod_example.py>__)
    • 2009
    • [#Kriegel2009Outlier]_
    • 基于邻近度
    • ROD
    • 基于旋转的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/rod_example.py>__)
    • 2020
    • [#Almardeny2020A]_
    • 异常集成
    • IForest
    • 孤立森林 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/iforest_example.py>__)
    • 2008
    • [#Liu2008Isolation]_
    • 异常集成
    • INNE
    • 基于最近邻集成的隔离式异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/inne_example.py>__)
    • 2018
    • [#Bandaragoda2018Isolation]_
    • 异常集成
    • DIF
    • 用于异常检测的深度孤立森林 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/dif_example.py>__)
    • 2023
    • [#Xu2023Deep]_
    • 异常集成
    • FB
    • 特征袋装 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/feature_bagging_example.py>__)
    • 2005
    • [#Lazarevic2005Feature]_
    • 异常集成
    • LSCP
    • LSCP: 并行异常集成的局部选择性组合 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/lscp_example.py>__)
    • 2019
    • [#Zhao2019LSCP]_
    • 异常集成
    • XGBOD
    • 基于极端提升的异常检测 (监督) (示例 <https://github.com/yzhao062/pyod/blob/development/examples/xgbod_example.py>__)
    • 2018
    • [#Zhao2018XGBOD]_
    • 异常集成
    • LODA
    • 轻量级在线异常检测器 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/loda_example.py>__)
    • 2016
    • [#Pevny2016Loda]_
    • 异常集成
    • SUOD
    • SUOD: 加速大规模无监督异构异常检测 (加速) (示例 <https://github.com/yzhao062/pyod/blob/development/examples/suod_example.py>__)
    • 2021
    • [#Zhao2021SUOD]_
    • 神经网络
    • AutoEncoder
    • 全连接自编码器(以重构误差作为异常分数)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/auto_encoder_example.py>__)
    • [#Aggarwal2015Outlier]_ [Ch.3]
    • 神经网络
    • VAE
    • 变分自编码器(以重构误差作为异常分数)(示例 <https://github.com/yzhao062/pyod/blob/development/examples/vae_example.py>__)
    • 2013
    • [#Kingma2013Auto]_
    • 神经网络
    • Beta-VAE
    • 具有自定义损失(gamma 和 capacity)的变分自编码器 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/vae_example.py>__)
    • 2018
    • [#Burgess2018Understanding]_
    • 神经网络
    • SO_GAAL
    • 单目标生成对抗主动学习 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/so_gaal_example.py>__)
    • 2019
    • [#Liu2019Generative]_
    • 神经网络
    • MO_GAAL
    • 多目标生成对抗主动学习 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/mo_gaal_example.py>__)
    • 2019
    • [#Liu2019Generative]_
    • 神经网络
    • DeepSVDD
    • 深度一类分类 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/deepsvdd_example.py>__)
    • 2018
    • [#Ruff2018Deep]_
    • 神经网络
    • AnoGAN
    • 基于生成对抗网络的异常检测
    • 2017
    • [#Schlegl2017Unsupervised]_
    • 神经网络
    • ALAD
    • 对抗学习的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/alad_example.py>__)
    • 2018
    • [#Zenati2018Adversarially]_
    • 神经网络
    • AE1SVM
    • 基于自编码器的一类支持向量机 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/ae1svm_example.py>__)
    • 2019
    • [#Nguyen2019scalable]_
    • 神经网络
    • DevNet
    • 基于偏差网络的深度异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/devnet_example.py>__)
    • 2019
    • [#Pang2019Deep]_
    • 基于图
    • R-Graph
    • 基于 R-graph 的异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/rgraph_example.py>__)
    • 2017
    • [#You2017Provable]_
    • 基于图
    • LUNAR
    • LUNAR: 通过图神经网络统一局部异常检测方法 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/lunar_example.py>__)
    • 2022
    • [#Goodge2022Lunar]_
    • 基于嵌入
    • EmbeddingOD
    • 通过基础模型嵌入、文本、图像和音频进行多模态异常检测 (示例 <https://github.com/yzhao062/pyod/blob/development/examples/embedding_od_example.py>__)
    • 2025
    • [#Li2024NLPADBench]_
    • 深度学习
    • AnomalyTransformer
    • 具有关联差异的 Transformer (实验性)
    • 2022
    • [#Xu2022Anomaly]_
  • Radar
  • 通过矩阵分解进行残差分析 (radar 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_radar_example.py>__)
  • 2017
  • [#Li2017Radar]_
    • 矩阵分解
    • ANOMALOUS
    • 带有拉普拉斯正则化的联合 MF (anomalous 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_anomalous_example.py>__)
    • 2018
    • [#Peng2018ANOMALOUS]_
    • 结构型
    • SCAN
    • 结构聚类,无需特征 (scan 示例 <https://github.com/yzhao062/pyod/blob/development/examples/pyg_scan_example.py>__)
    • 2007
    • [#Xu2007SCAN]_