问题描述
我正在使用 PyML 进行SVM分类.但是,我注意到当我使用LOO评估多分类器时,结果对象不会报告灵敏度和PPV值.相反,它们是0.0:
I am using PyML for SVM classification. However, I noticed that when I evaluate a multi-class classifier using LOO, the results object does not report the sensitivity and PPV values. Instead they are 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
我看过代码,但无法弄清楚这里出了什么问题.有人为此有解决方法吗?
I have looked at the code but couldn't figure out what is going wrong here. Has somebody a workaround for this?
推荐答案
对于多类问题,您无法获得常规的精确度/召回率"度量.您必须为每个类别获得Precision/Recall,然后才能计算加权平均值.
You cannot get the usual Precision/Recall measurements on a multi-class problem. You have to get Precision/Recall for each class, and you can compute a weighted average.
我不了解PyML的具体细节,但是您可以仔细研究一下预测并为每个类计算它们.
I don't know about the specifics of PyML, but you can just go through the predictions and calculate them for each class.
这篇关于获取PyML中多类问题的召回率(灵敏度)和精度(PPV)值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!