【问题标题】:SVM-Light displays corrupted precision/recall resultsSVM-Light 显示损坏的精度/召回结果
【发布时间】:2016-03-25 01:14:27
【问题描述】:
我运行 SVM-Light 分类器,但它输出的召回率/精度行似乎已损坏:
Reading model...OK. (20 support vectors read)
Classifying test examples..100..200..done
Runtime (without IO) in cpu-seconds: 0.00
Accuracy on test set: 95.50% (191 correct, 9 incorrect, 200 total)
Precision/recall on test set: 0.00%/0.00%
我应该如何配置才能获得有效的精度和召回率?
【问题讨论】:
标签:
machine-learning
svmlight
【解决方案1】:
例如,如果你的分类器总是预测“-1”——负类;但是,您的测试数据集包含 191 个“-1”和 9 个“+1”作为黄金标签,您将得到 191 个正确分类和 9 个错误分类。
True positives : 0 (TP)
True negatives : 191 (TN)
False negatives: 9 (FN)
False positives: 0 (FP)
Thus:
TP 0
Precision = ----------- = --------- = undefined
TP + FP 0 + 0
TP 0
Recall = ----------- = --------- = 0
TP + FN 0 + 9
从上面的公式可以知道,只要你的 TP 为零,你的precision/recall 要么为零,要么未定义。
要进行调试,您应该(对于每个测试示例)输出黄金标签和预测标签,以便您知道问题出在哪里。
【解决方案2】:
谢谢你。你的回答也帮助了我。
为避免此问题,请确保选择/分组测试和训练数据集,使它们具有公平的正值和负值组合。