Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong probability estimation when learning from a dataset with two samples #166

Closed
wyykak opened this issue Apr 30, 2020 · 2 comments
Closed

Comments

@wyykak
Copy link

wyykak commented Apr 30, 2020

from libsvm.svmutil import *
y, x = [1, -1], [[1,0,0], [-1,0,0]]
prob = svm_problem(y, x)
param = svm_parameter('-t 0 -b 1')
model = svm_train(prob, param)
p_label, p_acc, p_val = svm_predict(y, x, model,'-b 1')
print(p_val)

Output:

Accuracy = 0% (0/2) (classification)
[[0.3333333338127693, 0.6666666661872307], [0.6666666661872306, 0.3333333338127694]]

This happens with all the interfaces.

@cjlin1
Copy link
Owner

cjlin1 commented Apr 30, 2020 via email

@wyykak
Copy link
Author

wyykak commented Apr 30, 2020

This is very helpful! Thank you for you reply!

@wyykak wyykak closed this as completed Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants