界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

classic-detectors

classic-detectors

【数据与研究】Operate PyOD's classic tabular detector API for numeric arrays: detector selection, fit/predict/score workflows, synthetic data utilities, score interpretation, and CPU smoke checks.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: classic-detectors description: "Operate PyOD's classic tabular detector API for numeric arrays: detector selection, fit/predict/score workflows, synthetic data utilities, score interpretation, and CPU smoke checks." disable-model-invocation: true metadata: disco-role: operating license: BSD 2-Clause

Classic PyOD Detectors

Use this sub-skill when the user wants classic PyOD anomaly/outlier detection on tabular or numeric array data and already has, or can produce, a 2D numeric feature matrix X shaped (n_samples, n_features).

Best-fit tasks

  • Start a novice on the common fit -> decision_function -> predict workflow.
  • Choose a reasonable classic detector family for tabular data.
  • Explain fitted detector attributes such as decision_scores_, labels_, and threshold_.
  • Generate synthetic numeric data with pyod.utils.data and evaluate scores with ROC-AUC / precision @ rank n.
  • Run a deterministic CPU smoke check with a bundled synthetic-data script.

Route elsewhere

  • ADEngine, pyod CLI, MCP server, and agent lifecycle orchestration -> automated-lifecycle.
  • Time series, graph, embedding, text, image, audio, and deep optional-backend workflows -> specialized-modalities.
  • Model persistence, trusted load/save, score thresholding via PyThresh, score combination, SUOD/XGBOD operational extras -> model-operations.
  • Repository source layout, tests, docs, package metadata, or packaged skill maintenance -> repo-maintenance.

Quick operating default

For an unlabeled numeric table, prefer a simple, defensible baseline first:

from pyod.models.ecod import ECOD

clf = ECOD(contamination=0.1)
clf.fit(X_train)
train_scores = clf.decision_scores_        # higher means more abnormal
train_labels = clf.labels_                 # 0=inlier, 1=outlier
test_scores = clf.decision_function(X_test)
test_labels = clf.predict(X_test)

If the user cares about high-dimensional scalability, try IForest or COPOD; for local-density anomalies on moderate-size, scaled numeric data, try KNN or LOF. Do not report raw scores as calibrated probabilities; convert to ranks/percentiles, binary labels, or predict_proba outputs.

References and bundled scripts

Load these local files as needed:

  • API reference: BaseDetector methods/attributes, common detector signatures, and pyod.utils.data helper contracts.
  • Workflows: novice quick-start, detector-selection flow, preprocessing/validation steps, score interpretation, and multi-detector comparison recipes.
  • Model overview: detector-family routing table for probabilistic, linear, proximity, ensemble, and neural-at-routing-level choices.
  • Troubleshooting: concrete symptoms and recovery actions for input validation, contamination, scaling, optional imports, slow detectors, and score interpretation.
  • Classic detector smoke script: deterministic synthetic-data train/evaluate helper adapted from PyOD's basic KNN example; use it to sanity-check IForest, KNN, ECOD, or COPOD in the current Python environment.
我的收藏