1
$\begingroup$

I would like to know the differences between:

  • linearSVC()

  • SVC(kernel='lineaer)

  • SVC(kernel='poly', degree=1)

Will these all determine the same boundary decisions?

$\endgroup$

2 Answers 2

1
$\begingroup$

You can see in the user guide that the first two will not produce the same results. In the multiclass setting, LinearSVC uses one-vs-rest while SVC uses one-vs-one. Aside from that, the solver used is also different, and because of that some of the options differ. See LinearSVC docs, SVC docs.

I suspect the third will be the same as the second. I don't see anything in the source to indicate it quickly, but it shouldn't take long to test.

$\endgroup$
1
$\begingroup$

None of them are the same. linearSVC() uses one-vs-rest and SVC(kernel='linear) uses one-vs-one for classification.

To have the same results with the SVC poly kernel as with the SVC linear we have to set the gamma parameter to 1 otherwise the default is to use 1 / (n_features * X.var) weakening the value from the now linear kernel.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.