zoukankan      html  css  js  c++  java
  • sklearn之SVC

    sklearn.svm.SVC(C=1.0, kernel='rbf', degree=3, gamma='auto', coef0=0.0, shrinking=True, probability=False,

    tol=0.001, cache_size=200, class_weight=None, verbose=False, max_iter=-1, decision_function_shape=None,random_state=None)

    参数:

    l  C:C-SVC的惩罚参数C?默认值是1.0

    C越大,相当于惩罚松弛变量,希望松弛变量接近0,即对误分类的惩罚增大,趋向于对训练集全分对的情况,这样对训练集测试时准确率很高,但泛化能力弱。C值小,对误分类的惩罚减小,允许容错,将他们当成噪声点,泛化能力较强。

    l  kernel :核函数,默认是rbf,可以是‘linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed’ 

        0 – 线性:u'v

        1 – 多项式:(gamma*u'*v + coef0)^degree

        2 – RBF函数:exp(-gamma|u-v|^2)

        3 –sigmoid:tanh(gamma*u'*v + coef0)

    l  degree :多项式poly函数的维度,默认是3,选择其他核函数时会被忽略。

    l  gamma : ‘rbf’,‘poly’ 和‘sigmoid’的核函数参数。默认是’auto’,则会选择1/n_features

    l  coef0 :核函数的常数项。对于‘poly’和 ‘sigmoid’有用。

    l  probability :是否采用概率估计?.默认为False

    l  shrinking :是否采用shrinking heuristic方法,默认为true

    l  tol :停止训练的误差值大小,默认为1e-3

    l  cache_size :核函数cache缓存大小,默认为200

    l  class_weight :类别的权重,字典形式传递。设置第几类的参数C为weight*C(C-SVC中的C)

    l  verbose :允许冗余输出?

    l  max_iter :最大迭代次数。-1为无限制。

    l  decision_function_shape :‘ovo’, ‘ovr’ or None, default=None3

    l  random_state :数据洗牌时的种子值,int值

    主要调节的参数:C、kernel、degree、gamma、coef0。


  • 相关阅读:
    排序数据记录查询
    条件数据记录查询
    简单数据记录查询
    缓冲流
    转换流
    删除数据记录
    更新数据记录
    插入数据记录
    移动前端自适应适配布局解决方案和比较
    如何解决inline-block元素的空白间距
  • 原文地址:https://www.cnblogs.com/the-wolf-sky/p/10315016.html
Copyright © 2011-2022 走看看