Open QiangZiBro opened 4 years ago
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
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.
我根本不会改这个mistake,只好去用封装好的scikit-learn,结果。。。。太香了家人们!!!!
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: