When data is offset (not centered in zero), LinearSVC()
and SVC(kernel=\'linear\')
are giving awfully different results. (EDIT: the problem might b
Reading the documentation, they are using different underlying implementations. LinearSVC
is using liblinear where SVC
is using libsvm.
Looking closely at the coefficients and intercept, it seems LinearSVC
applies regularization to the intercept where SVC
does not.
By adding intercept_scaling, I was able to obtain the same results to both.
LinearSVC(loss='hinge', intercept_scaling=1000)