ajtulloch / svmpy

Basic soft-margin kernel SVM implementation in Python
252 stars 114 forks source link

A mistake about computing bias term #6

Open Jun-jie-Huang opened 5 years ago

Jun-jie-Huang commented 5 years ago

Hi, I've implemented a soft-margin SVM with kernel function and I referred to yours. I found there's a problem in your code to compute the bias term in the training process in this line.. Your code compute the by using the SVMPredictor which you set bias to 0. In this way, you compute the term AND use a sign function. But in the SVM algorithm, the sign function is not used in computing the bias term.

MatrixRanger98 commented 4 years ago

Yes. We shouldn't use sign function here. That is a major mistake rather than a bug. I highly suggest correcting it as there are already many webpages on svm quoting this repo.