ROC curve & AUC / ROC 曲线与 AUC
roc_aucROC curve & AUC / ROC 曲线与 AUC | USE WHEN: the user has a binary gold standard and predicted scores/probabilities and wants AUC, ROC curve, discrimination, or the best cut-off | ALIASES: ROC, AUC, 曲线下面积, 诊断效能, 最佳阈值, cutoff, discrimination, 敏感度特异度, ROC曲线 | RETURNS: AUC、最优阈值、敏感度特异度
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"labels": [
0,
1,
0,
1,
1,
0
],
"scores": [
0.1,
0.9,
0.2,
0.8,
0.7,
0.3
]
},
"name": "roc_auc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labels | Yes | 真实标签,只能取 0/1(也认 yes/no、阳性/阴性)。**两个类别各需至少 2 例**——总例数 <4 或某类只有 1 例时直接 400:样本这么少 AUC 的置信区间没有意义,本接口不给一个看起来精确的假数值。长度须等于 scores。 | |
| scores | Yes | 模型对每个样本的输出分数或预测概率,长度须等于 labels。AUC 只看排序不看绝对量纲,概率(0~1)或原始 logit 分数都可以。返回 AUC、95% CI、最佳阈值及对应敏感度/特异度。 |