You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had implemented my own svm based on your implementation. Wierdly, the accuracy was very low.
I copied your code and use sklearn has a benchemark. Your svm implementation gives me back almost random prediction.
Did you normalize your data before you used rbf kernel?
In your example, there are 3 classes (0, 1, 2). If you removed one class (say 0) and then ran the implementation, your accuracy would improve greatly.
On this website (https://pythonprogramming.net/soft-margin-kernel-cvxopt-svm-machine-learning-tutorial/), the code is pretty identical with a couple of slight differences.. anyhow, running this code with with how you created your dataset yielded a WORSE accuracy. On the bottom of the page, the author wrote that this SVM code is meant to display the inner workings and not for robust usage. So similarly, this is applied here.
I had implemented my own svm based on your implementation. Wierdly, the accuracy was very low.
I copied your code and use sklearn has a benchemark. Your svm implementation gives me back almost random prediction.
Here is the code for you to check.
https://github.com/tchaton/interviews_prep/blob/master/code_prep/mlfromscratch/supervised/svm.py
The text was updated successfully, but these errors were encountered: