Smith Patterson
Smith Patterson

Reputation: 101

Scikit learn multi-class classification for support vector machines

I want to know whether LinearSVC supports multi-class classification by default or do we have to wrap it in OneVsRestClassifier like:

 OneVsRestClassifier(LinearSVC())

Upvotes: 1

Views: 2745

Answers (1)

IVlad
IVlad

Reputation: 43477

According to this part of the documentation:

SVC, NuSVC and LinearSVC are classes capable of performing multi-class classification on a dataset.

[...]

On the other hand, LinearSVC implements “one-vs-the-rest” multi-class strategy, thus training n_class models. If there are only two classes, only one model is trained:

So it supports multiclass classification by default.

Upvotes: 5

Related Questions