栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

SVC(kernel=‘linear‘)和LinearSVC的不同

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SVC(kernel=‘linear‘)和LinearSVC的不同

随手做一个笔记了算是:

Question:

  1. what’s different between SVC and LinearSVC in python sklearn library?
  2. Does the SVC(kernel='linear') have the same result on LinearSVC()
  3. if we want to model the linear kernel how do we choose?

Reply:

  1. What is the difference between SVC and SVM in scikit-learn?
    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.

  2. Under what parameters are SVC and LinearSVC in scikit-learn equivalent?
    Personally I consider LinearSVC one of the mistakes of sklearn developers - this class is simply not a linear SVM.
    To sum up: LinearSVC is not linear SVM, do not use it if do not have to.

  3. When should one use LinearSVC or SVC?
    Between SVC and LinearSVC, one important decision criterion is that LinearSVC tends to be faster to converge the larger the number of samples is. This is due to the fact that the linear kernel is a special case, which is optimized for in Liblinear, but not in Libsvm.

  4. From documentation, you can also see the theory and math:
    https://scikit-learn.org/stable/modules/svm.html#svc

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/656296.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号