Comments (3)
This isn't a bug. Please see the following libsvm faq.
Q: Why using svm-predict -b 0 and -b 1 gives different accuracy values?
Let's just consider two-class classification here. After probability information is obtained in training, we do not have
prob > = 0.5 if and only if decision value >= 0.
So predictions may be different with -b 0 and 1.
Nick writes:
I am using libsvm 3.20. I have a dataset which causes svm_predict() and
svm_predict_probability() to give different results. In particular, svm_predict()
classifies everything to one class, which is definitely wrong for this dataset.You can trigger it with the command line tools as follows
wget https://github.com/kousu/statasvm/raw/master/bugs/libsvm_classification/classification_bug.svmlight
svm-train -b 1 classification_bug.svmlight FIT >/dev/null &&
svm_predict(), incorrect
svm-predict -b 0 classification_bug.svmlight FIT P
cat Psvm_predict_probability(), correct (or at least, reasonable)
svm-predict -b 1 classification_bug.svmlight FIT P
cat PTabulating the results, I see
svm_predict(), incorrect
Model supports probability estimates, but disabled in prediction.
Accuracy = 53.5294% (91/170) (classification)
170 1svm_predict_probability()
Accuracy = 84.7059% (144/170) (classification)
labels 0 1 2 3
61 0
100 1
9 2Reference dataset and full test cases are at
https://github.com/kousu/statasvm/tree/master/bugs/libsvm_classification. This
showed up when run from my Stata wrapper in that repo, but it is also in sklearn
and in your command line tools.I hit the svm_predict() bug a week ago, but I was even more surprised to see that
despite it, you can still good answers out of libsvm by tweaking parameters. Given
the huge number of machine learning projects that are dependent on your code,
there must be a lot of subtlely incorrect predictions that no one is catching. Do
you have any idea what would cause this?—
Reply to this email directly or view it on GitHub.*
from libsvm.
I missed that in the FAQ. It is short and hard to interpret. Perhaps incorporating some of the points made by sklearn would make this corner-case clearer.
from libsvm.
Agreed, sklearn has the best documentation.
from libsvm.
Related Issues (20)
- how can i improve train speed? HOT 1
- why my memory always HOT 1
- Some dataset problem HOT 2
- static library HOT 1
- gridregression.py
- LIBSVM library not found HOT 1
- gridregression.py 出现 RuntimeError: get no mse HOT 2
- Exception Thrown: read access violation HOT 1
- 使用svm-train.exe做回归(regression),参数c与g如何优化 HOT 1
- How to modify SVR loss function? HOT 1
- Accuracies lower than 50% if the random seed is unlucky HOT 8
- one class svm HOT 1
- Questions about the results of libSVM HOT 6
- Questions about probability estimation of one-class svm HOT 4
- 如何调整nu,使训练集的准确率增加? HOT 6
- cannot find -lgcc: No such file or directory HOT 1
- When using svm-scale , missing values come out. HOT 1
- Try using a custom objective function
- MATLAB Crashes when trying to run "svmtrain" on CentOS HOT 2
- Python libsvm 3.33 crashes due to unexpected argument to jit HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsvm.