machine-learning - SVM-Light 显示损坏的精度/召回结果

标签 machine-learning svmlight

我运行 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%

我应该配置什么才能获得有效的精度和召回率?

最佳答案

例如,如果你的分类器总是预测“-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 为零,您的精度/召回率要么为零,要么未定义。

要进行调试,您应该输出(对于每个测试示例)黄金标签和预测标签,以便您知道问题出在哪里。

关于machine-learning - SVM-Light 显示损坏的精度/召回结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29634695/

相关文章:

python-3.x - 使用随机森林时 scikit 中的 "ValueError: max_features must be in (0, n_features] "

machine-learning - 如何解释 SVM-light 结果

python - 为什么 xgboost 的 Dmatrix 加载 svm 轻文本文件如此快

c++ - dyld : Library not loaded: lib/libopencv_core. 3.0.dylib 原因:找不到图片

python - Tensorflow:tf.case 参数化可调用,案例列表在 for 循环中定义

python - 对于我的数据,为什么基于树的学习算法的准确率只有50%左右?

R Keras 压平层 - 得到形状为 1 的数组

machine-learning - 如何通过交叉验证在 svmlight 中获得训练准确性

c++ - 如何在 C++ 代码中使用 SVM Light? (可能不从 C++ 代码调用可执行文件)

python - 使用 keras tokenizer 处理不在训练集中的新词