Xtra-Computing / thundersvm

ThunderSVM: A Fast SVM Library on GPUs and CPUs
Apache License 2.0
1.56k stars 217 forks source link

How to get coef of linear svm?(w, b) #223

Open black1001 opened 4 years ago

black1001 commented 4 years ago

Hello. I want to get the coefficients of linear svm for my own desicion funciton(y=w*x+b), and try in this way:

w = model.coef_.T
b = model.intercept_

but the signs and categories of y cannot correspond.

How can I get w and b, so as to predict the label of y by the sign of w*x+b?

zeyiwen commented 4 years ago

The way you used to obtain w and b is correct. Maybe you have issues in other places?