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

Suppport Vector Machine Problem #41

Open
tchaton opened this issue May 20, 2018 · 2 comments
Open

Suppport Vector Machine Problem #41

tchaton opened this issue May 20, 2018 · 2 comments

Comments

@tchaton
Copy link

tchaton commented May 20, 2018

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

@tchaton
Copy link
Author

tchaton commented May 20, 2018

And idx = lagr_mult > 1e-7 create an error too using the last dataset. I modified it to idx = lagr_mult > 1e-11. But it isn t a good solution.

@akhilvasvani
Copy link

akhilvasvani commented Mar 25, 2019

  1. Did you normalize your data before you used rbf kernel?

  2. 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.

  3. 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.

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