Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
2 views
in Machine Learning by (4.2k points)

From the documentation, scikit-learn implements SVC, NuSVC, and LinearSVC which are classes capable of performing multi-class classification on a dataset. By the other hand, I also read about that scikit learn also uses libsvm for support vector machine algorithm. I'm a bit confused about what's the difference between SVC and libsvm versions, by now I guess the difference is that SVC is the support vector machine algorithm for the multiclass problem and libsvm are for the binary class problem. Could anybody help me to understand the difference between this?.

1 Answer

+2 votes
by (6.8k points)
edited by

They are just different implementations of the same algorithm. The SVM module (SVC, NuSVC, etc) is a wrapper around the libsvm library and supports different kernels while LinearSVC is based on liblinear and only supports a linear kernel. So:

SVC(kernel = 'linear')

is in theory "equivalent" to:

LinearSVC()

Because the implementations are completely different in follow you may get different results, the most necessary ones being that LinearSVC solely supports a linear kernel, is quicker and may scale a lot better.

For more details on this, study the SVM Algorithm Tutorial.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...