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

detection_metric_protocol

detection_metric_protocol

【效率与协作】Compute AUROC and AUPR detection metrics with paper-faithful score orientations for softmax confidence baselines.

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

技能说明

GitHub

name: detection_metric_protocol description: Compute AUROC and AUPR detection metrics with paper-faithful score orientations for softmax confidence baselines.

Threshold-Independent Detection Metrics

Use this skill when evaluating maximum-softmax-probability detectors for misclassification or out-of-distribution examples. It implements the paper convention of reporting AUROC and AUPR rather than choosing a single threshold.

Inputs

  • Binary labels where 1 is the positive detector class.
  • Numeric scores where larger means more likely positive.
  • Optional metadata naming the protocol, such as success, error, in, or out.

Outputs

  • auroc, aupr, base_rate, counts, and sorted ranking diagnostics.

Workflow

  1. Choose score orientation before calling the metric: MSP for success/in-distribution positive, negative MSP for error/out-of-distribution positive.
  2. Compute AUROC as pairwise positive-vs-negative ranking probability with half credit for ties.
  3. Compute average precision by scanning descending scores and averaging precision at positive ranks.
  4. Report the positive base rate so AUPR can be compared to the random baseline.

Validation

Run python tests/test_metrics.py or validate the full skill tree with validate_skill_tree.py --run-tests.

Limitations

This skill does not infer labels or generate scores. It assumes the caller has already created paper-faithful positive labels and score orientation.

我的收藏