scikit-learn中的SVC和SVM有什么区别? [英] What is the difference between SVC and SVM in scikit-learn?

查看:2342
本文介绍了scikit-learn中的SVC和SVM有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档中,scikit-learn实现了SVC,NuSVC和LinearSVC,它们是能够执行多数据集上的分类.另一方面,我还阅读了有关scikit的内容,学习还使用libsvm作为支持向量机算法.我对SVC和libsvm版本之间的区别有些困惑,现在我想区别是SVC是多类问题的支持向量机算法,而libsvm是二进制类的问题.有人可以帮我低估两者之间的区别吗?.

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 fot the multiclass problem and libsvm is for the binary class problem. Could anybody help me to understad the difference between this?.

推荐答案

它们只是同一算法的不同实现. SVM模块(SVC,NuSVC等)是 libsvm 的包装>库并支持不同的内核,而LinearSVC基于 liblinear 和仅支持线性内核.所以:

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')

理论上等同于:

LinearSVC()

由于实践中的实现方式不同,您将获得不同的结果,最重要的是LinearSVC仅支持线性内核,速度更快并且可以更好地扩展.

Because the implementations are different in practice you will get different results, the most important ones being that LinearSVC only supports a linear kernel, is faster and can scale a lot better.

这篇关于scikit-learn中的SVC和SVM有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆