抑制libsvm中的输出(python) [英] Suppressing the output in libsvm (python)

查看:196
本文介绍了抑制libsvm中的输出(python)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用来自python的libsvm(svmutils)进行分类任务.分类器是准确的.但是,我得到这样的输出:

I am using libsvm (svmutils) from python for a classification task. The classifier is exact. However, I am getting output like this:

*
optimization finished, #iter = 75
nu = 0.000021
obj = -0.024330, rho = 0.563710
nSV = 26, nBSV = 0
Total nSV = 26
*
optimization finished, #iter = 66
nu = 0.000030
obj = -0.035536, rho = -0.500676
nSV = 21, nBSV = 0
Total nSV = 21
*
optimization finished, #iter = 78
nu = 0.000029
obj = -0.033921, rho = -0.543311
nSV = 23, nBSV = 0
Total nSV = 23
*
optimization finished, #iter = 90
nu = 0.000030
obj = -0.035333, rho = -0.634721
nSV = 23, nBSV = 0
Total nSV = 23
Accuracy = 0% (0/1) (classification)
Accuracy = 0% (0/1) (classification)
Accuracy = 0% (0/1) (classification)
Accuracy = 0% (0/1) (classification)

有什么办法可以禁止显示此对话框?分类器的效果很好,我很好奇.另外,"Accuracy"代表什么?为什么在我的情况下是0%? (数据在80个维度上不重叠.共有4个类.我也对其进行了规范化.)

Is there any way I can suppress this dialog? The classifier serves perfectly fine, I am just curious. Also, what does the "Accuracy" stand for? And why this is 0% in my case? (The data is non-overlapping in 80 dimensions. Total 4 classes. I have also normalized it properly.)

推荐答案

使用-q参数选项

import svmutil
param = svmutil.svm_parameter('-q')
...

import svmutil
x = [[0.2, 0.1], [0.7, 0.6]]
y = [0, 1]
svmutil.svm_train(y, x, '-q')

这篇关于抑制libsvm中的输出(python)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆