Scikit学习支持向量机的多类分类 [英] Scikit learn multi-class classification for support vector machines
本文介绍了Scikit学习支持向量机的多类分类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道LinearSVC
默认是否支持多类分类,还是我们必须将其包装在OneVsRestClassifier
中?
I want to know whether LinearSVC
supports multi-class classification by default or do we have to wrap it in OneVsRestClassifier
like:
OneVsRestClassifier(LinearSVC())
推荐答案
根据文档的这一部分:
SVC,NuSVC和 LinearSVC 是能够对数据集执行多类分类的类.
SVC, NuSVC and LinearSVC are classes capable of performing multi-class classification on a dataset.
[...]
另一方面, LinearSVC 实现了一个对另一个"的多类策略,从而训练了n_class个模型.如果只有两节课,则只会训练一种模型:
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.
这篇关于Scikit学习支持向量机的多类分类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文