在 PyML 中获取多类问题的召回(灵敏度)和精度(PPV)值

mat*_*ias 1 python classification machine-learning svm pyml

我正在使用PyML进行 SVM 分类。但是,我注意到当我使用 LOO 评估多类分类器时,结果对象不会报告灵敏度和 PPV 值。相反,它们是 0.0:

from PyML import *
from PyML.classifiers import multi

mc = multi.OneAgainstRest(SVM())
data = VectorDataSet('iris.data', labelsColumn=-1)
result = mc.loo(data)

result.getSuccessRate()
>>> 0.95333333333333337
result.getPPV()
>>> 0.0
result.getSensitivity()
>>> 0.0
Run Code Online (Sandbox Code Playgroud)

我查看了代码,但无法弄清楚这里出了什么问题。有人有解决方法吗?

smo*_*ola 6

对于多类问题,您无法获得通常的 Precision/Recall 测量值。您必须获得每个类别的 Precision/Recall,并且您可以计算加权平均值。

我不知道 PyML 的细节,但你可以通过预测并为每个类计算它们。