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

svm using linear kernel can't solve some simple case #7

Open
QiangZiBro opened this issue Nov 19, 2019 · 2 comments
Open

svm using linear kernel can't solve some simple case #7

QiangZiBro opened this issue Nov 19, 2019 · 2 comments

Comments

@QiangZiBro
Copy link

Hello,your code is great, but I tried a case with 3 points, using linear kernel, but it doesn't work out right answer, I don't know why, my test code is below:

    samples=np.array([[0,0],[1,1],[0,1]],dtype=np.float)
    labels=np.array([1,1,-1],dtype=np.float)

    trainer = svmpy.SVMTrainer(svmpy.Kernel.linear(), 0.5)
    predictor = trainer.train(samples, labels)
    print(predictor.predict([0,1])) #should output -1

@Schuck9
Copy link

Schuck9 commented Apr 17, 2020

There is a mistake in computing bias .You can reffer the Jun-jie-Huang's issue to correct it. After I fixed the mistake ,it works in simple cases.

@qiuxika
Copy link

qiuxika commented Oct 13, 2021

我根本不会改这个mistake,只好去用封装好的scikit-learn,结果。。。。太香了家人们!!!!

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

3 participants