Skip to content

Clarify the differences between LinearSVC and SVC #26812

@vnmabus

Description

@vnmabus

Describe the issue linked to the documentation

Currently the documentation for LinearSVC says that is "Similar to SVC with parameter kernel="linear", but implemented in terms of liblinear rather than libsvm, so it has more flexibility in the choice of penalties and loss functions and should scale better to large numbers of samples".

This is confusing, because by default they are not equivalent. LinearSVC has a different default loss function and regularizes the intercept, as mentioned in these StackOverflow posts:

As a result, the current documentation can mislead and give result to research that does the wrong thing, as it almost happened to me.

Suggest a potential alternative/fix

A big red box with a warning should be at the beginning of the documentation for LinearSVC, describing the ways in which differs from SVC and that it is not a "true" linear SVM (because of the intercept regularization).

In the future, it would be desirable in my opinion to change the default values/implementation of LinearSVC so that both LinearSVC and SVC with parameter kernel="linear" solve the same optimization problem by default. Otherwise the risk of it leading to wrong research results is very big.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions