machine-learningscikit-learnsvm

Is sklearn LinearSVC an SVM or SVC?


I was watching a YouTube video to learn about Support Vector Machines (SVM). In the video, he mentions that an SVM finds Support Vector Classifiers (SVC) for dividing the data as one step in their classifying process.

I have used LinearSVC from scikit-learn for classification, but I have a hard time understanding if the implementation of LinearSVC in scikit-learn is an SVM or an SVC, or if the description in the video is incorrect. I find contradicting descriptions on different sites.

  1. The accepted answer in this question states that LinearSVC is not an SVM, but either it does not say that it is an SVC.
  2. On the description page of LinearSVC it says "Linear Support Vector Classification", but under "See also" on this page, it says that LinearSVC is "Scalable Linear Support Vector Machine for classification implemented using liblinear".

From what I can understand, LinearSVC and SVC(kernel='linear') are not the same, but that is not the question.


Solution

  • In terms of Machine Learning concepts LinearSVC is both because:

    So, an SVC would be a kind of SVM and LinearSVC looks like a specific kind of SVC, although not extending a base SVC class in scikit-learn.

    If you mean sklearn source code - the LinearSVC is in the svm module... so it's an SVM. It doesn't extend the SVC or BaseSVC classes but to me this is an implementation issue/detail and I'd rather think of it as an SVC.