【问题标题】:Box constraint in libsvm package (compare MATLAB fitcsvm and libsvm options)libsvm 包中的框约束(比较 MATLAB fitcsvm 和 libsvm 选项)
【发布时间】:2017-01-30 21:43:08
【问题描述】:

这些是 LIBSVM 包的选项:

   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)
    -d degree : set degree in kernel function (default 3)
    -g gamma : set gamma in kernel function (default 1/num_features)
    -r coef0 : set coef0 in kernel function (default 0)
    -c cost : set the parameter C of C-SVC, epsilon-SVR, and nu-SVR (default 1)
    -n nu : set the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5)
    -p epsilon : set the epsilon in loss function of epsilon-SVR (default 0.1)
    -m cachesize : set cache memory size in MB (default 100)
    -e epsilon : set tolerance of termination criterion (default 0.001)
    -h shrinking: whether to use the shrinking heuristics, 0 or 1 (default 1)
    -b probability_estimates: whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0)
    -wi weight: set the parameter C of class i to weight*C, for C-SVC (default 1)

哪一个是svm box-constraint?是-c吗?如果没有,我该如何计算?目前我正在将我的 LIBSVM 代码转换为 MATLAB fitcsvm 函数。我们在 MATLAB 中有这些选项:

    'Cost' — Misclassification cost
    square matrix | structure array
    Misclassification cost, specified as the comma-separated pair consisting of 'Cost' and a square matrix or structure. If you specify:

    The square matrix Cost, then Cost(i,j) is the cost of classifying a point into class j if its true class is i (i.e., the rows correspond to the true class and the columns correspond to the predicted class). To specify the class order for the corresponding rows and columns of Cost, additionally specify the ClassNames name-value pair argument.
    The structure S, then it must have two fields:
    S.ClassNames, which contains the class names as a variable of the same data type as Y
    S.ClassificationCosts, which contains the cost matrix with rows and columns ordered as in S.ClassNames
    For two-class learning, if you specify a cost matrix, then the software updates the prior probabilities by incorporating the penalties described in the cost matrix. Subsequently, the cost matrix resets to the default. For more details on the relationships and algorithmic behavior of BoxConstraint, Cost, Prior, Standardize, and Weights, see Algorithms.

    The defaults are:

    For one-class learning, Cost = 0.
    For two-class learning, Cost(i,j) = 1 if i ~= j, and Cost(i,j) = 0 if i = j.
    Example: 'Cost',[0,1;2,0]

    Data Types: double | single | struct

///

'BoxConstraint' — Box constraint
1 (default) | positive scalar
Box constraint, specified as the comma-separated pair consisting of 'BoxConstraint' and a positive scalar.

For one-class learning, the software always sets the box constraint to 1.

For more details on the relationships and algorithmic behavior of BoxConstraint, Cost, Prior, Standardize, and Weights, see Algorithms.

Example: 'BoxConstraint',100

Data Types: double | single

costBoxConstraint 与上述 libsvm 软件包选项相比有什么区别?

【问题讨论】:

    标签: matlab svm libsvm


    【解决方案1】:

    google 发现如下:

    -c = BoxConstraint

    -wicost

    -g = 1/(KernelScale^2) 如果使用 RBF

    【讨论】:

      猜你喜欢
      • 2015-02-16
      • 2016-08-14
      • 2013-10-21
      • 1970-01-01
      • 2015-09-18
      • 2013-02-19
      • 2015-01-07
      • 2016-09-27
      • 2014-09-09
      相关资源
      最近更新 更多