【问题标题】:Select optimized parameters for libsvm-linear kernel为 libsvm-linear 内核选择优化参数
【发布时间】:2016-05-16 05:17:37
【问题描述】:

我将 RBF 内核用于带有 libsvm 的 ML。我正在研究为我的数据集探索其他内核。

有多个参数可以针对特定内核进行优化。 C and g 参数用于网格搜索,以选择成本和伽玛的最佳组合。

-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)

我想知道每个内核的相关参数。由于有多个参数可供选择。例如:C and g 用于 RBF 内核。还提供网格大小和参数范围 例如:10^-3 to 10^11 for C and 10^3 to 10^-13 for g

我的 RBF 内核的 perl 网格生成器:

    for ( $i = -3; $i <= 11; $i += 1 ) {

    for ( $j = 3; $j >= -13; $j += -1 ) {

        my $a = 2**$i;
        my $b = 2**$j;

        $output = "svm-train -c $a -g $b -v 5 $ARGV[0]";

        print  "$output >& ${ARGV[0]}_${a}_${b}.out \n";

    }
}

【问题讨论】:

    标签: machine-learning svm libsvm


    【解决方案1】:

    libsvm 支持四种内核:linear、poly、rbf 和 sigmoid(这实际上不是一个有效的内核)。

    • 线性:无参数
    • poly: gamma (>0, float), coef0 (float), degree (>1, int)
    • rbf: 伽玛 (>0, 浮点数)
    • sigmoid: gamma (>0, float), coef0 (float)

    您不能真正提供一般参数网格,因为它们依赖于数据。

    C 是一个 SVM 参数,因此需要始终对其进行拟合。其余参数不是内核特定的,您不必担心它们。

    【讨论】:

    • 谢谢。您能否指定这些参数的常用范围(最小值、最大值和步数)。我知道它们依赖于数据。
    • 没有“通用范围”之类的东西,唯一的经验法则是对 C 和 gamma 使用几何级数。
    猜你喜欢
    • 2014-06-29
    • 2016-09-23
    • 2019-05-02
    • 2018-10-20
    • 1970-01-01
    • 2011-10-22
    • 2016-01-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多