【问题标题】:Libsvm: tools/easy.pyLibsvm:工具/easy.py
【发布时间】:2013-01-10 09:50:57
【问题描述】:

脚本 tools/easy.py 仅使用 rbf 内核。如何更改此脚本以使用其他内核(尤其是线性内核)执行实验?

谢谢

【问题讨论】:

    标签: python svm libsvm


    【解决方案1】:

    您需要通过svm-train [options] training_set_file [model_file] 选择您想要的svm_type 选项。 来自源代码中的 README 文件:

    options:
    -s svm_type : set type of SVM (default 0)
        0 -- C-SVC
        1 -- nu-SVC
        2 -- one-class SVM
        3 -- epsilon-SVR
        4 -- nu-SVR
    -t kernel_type : set type of kernel function (default 2)
        0 -- linear: u'*v
        1 -- polynomial: (gamma*u'*v + coef0)^degree
        2 -- radial basis function: exp(-gamma*|u-v|^2)
        3 -- sigmoid: tanh(gamma*u'*v + coef0)
        4 -- precomputed kernel (kernel values in training_set_file)
    

    因此线性将是-t 0

    README 中还列出了其他选项,它们会更改每个内核函数中使用的参数。

    【讨论】:

      猜你喜欢
      • 2011-11-08
      • 2014-05-02
      • 1970-01-01
      • 2014-11-17
      • 2013-05-17
      • 2017-07-08
      • 2012-07-21
      • 2013-11-14
      • 2018-04-10
      相关资源
      最近更新 更多