且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

scikit-learn中的SVC和SVM有什么区别?

更新时间:2021-12-08 10:11:23

它们只是同一算法的不同实现. 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.