首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MATLAB列车接口LIBLINEAR

MATLAB列车接口LIBLINEAR
EN

Stack Overflow用户
提问于 2014-01-24 18:42:52
回答 2查看 4.2K关注 0票数 2

LIBLINEAR文档中,我们有

代码语言:javascript
复制
matlab> model = train(training_label_vector, training_instance_matrix [,'liblinear_options', 'col']);

        -training_label_vector:
            An m by 1 vector of training labels. (type must be double)
        -training_instance_matrix:
            An m by n matrix of m training instances with n features.
            It must be a sparse matrix. (type must be double)
        -liblinear_options:
            A string of training options in the same format as that of LIBLINEAR.
        -col:
            if 'col' is set, each column of training_instance_matrix is a data instance. Otherwise each row is a data instance.

但是,即使在阅读了主页并查看了文档之后,我也无法找到liblinear_options的选项。

这是什么地方列出的但我显然是想不起来了?

此外,由于我无法在任何地方找到列出的liblinear_options,所以我被困在以下问题上:

train方法是否使用线性支持向量机来建立模型?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-01-25 01:00:02

利伯线性是一种线性分类器。除了支持向量机,它还包括基于logistic回归的分类器。是的,顾名思义,线性核应用于支持向量机。

您可以检查他们的github页面是否有liblinear_options。我在这里也抄袭了它们:

代码语言:javascript
复制
"liblinear_options:\n"
        "-s type : set type of solver (default 1)\n"
        "        0 -- L2-regularized logistic regression (primal)\n"
        "        1 -- L2-regularized L2-loss support vector classification (dual)\n"        
        "        2 -- L2-regularized L2-loss support vector classification (primal)\n"
        "        3 -- L2-regularized L1-loss support vector classification (dual)\n"
        "        4 -- multi-class support vector classification by Crammer and Singer\n"
        "        5 -- L1-regularized L2-loss support vector classification\n"
        "        6 -- L1-regularized logistic regression\n"
        "        7 -- L2-regularized logistic regression (dual)\n"
        "-c cost : set the parameter C (default 1)\n"
        "-e epsilon : set tolerance of termination criterion\n"
        "        -s 0 and 2\n" 
        "                |f'(w)|_2 <= eps*min(pos,neg)/l*|f'(w0)|_2,\n" 
        "                where f is the primal function and pos/neg are # of\n" 
        "                positive/negative data (default 0.01)\n"
        "        -s 1, 3, 4 and 7\n"
        "                Dual maximal violation <= eps; similar to libsvm (default 0.1)\n"
        "        -s 5 and 6\n"
        "                |f'(w)|_1 <= eps*min(pos,neg)/l*|f'(w0)|_1,\n"
        "                where f is the primal function (default 0.01)\n"
        "-B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default -1)\n"
        "-wi weight: weights adjust the parameter C of different classes (see README for details)\n"
        "-v n: n-fold cross validation mode\n"
        "-q : quiet mode (no outputs)\n"
票数 4
EN

Stack Overflow用户

发布于 2021-02-16 11:33:55

可能有一些新的发展,因为这是张贴的。在matlab提示符下运行火车会给你所有的选择。至少在R2020b上,我刚刚下载了liblinear的版本。

代码语言:javascript
复制
>> train
Usage: model = train(training_label_vector, training_instance_matrix, 'liblinear_options', 'col');
liblinear_options:
-s type : set type of solver (default 1)
  for multi-class classification
     0 -- L2-regularized logistic regression (primal)
     1 -- L2-regularized L2-loss support vector classification (dual)
     2 -- L2-regularized L2-loss support vector classification (primal)
     3 -- L2-regularized L1-loss support vector classification (dual)
     4 -- support vector classification by Crammer and Singer
     5 -- L1-regularized L2-loss support vector classification
     6 -- L1-regularized logistic regression
     7 -- L2-regularized logistic regression (dual)
  for regression
    11 -- L2-regularized L2-loss support vector regression (primal)
    12 -- L2-regularized L2-loss support vector regression (dual)
    13 -- L2-regularized L1-loss support vector regression (dual)
  for outlier detection
    21 -- one-class support vector machine (dual)
-c cost : set the parameter C (default 1)
-p epsilon : set the epsilon in loss function of SVR (default 0.1)
-n nu : set the parameter nu of one-class SVM (default 0.5)
-e epsilon : set tolerance of termination criterion
    -s 0 and 2
        |f'(w)|_2 <= eps*min(pos,neg)/l*|f'(w0)|_2,
        where f is the primal function and pos/neg are # of
        positive/negative data (default 0.01)
    -s 11
        |f'(w)|_2 <= eps*|f'(w0)|_2 (default 0.0001)
    -s 1, 3, 4, 7, and 21
        Dual maximal violation <= eps; similar to libsvm (default 0.1 except 0.01 for -s 21)
    -s 5 and 6
        |f'(w)|_1 <= eps*min(pos,neg)/l*|f'(w0)|_1,
        where f is the primal function (default 0.01)
    -s 12 and 13
        |f'(alpha)|_1 <= eps |f'(alpha0)|,
        where f is the dual function (default 0.1)
-B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default -1)
-R : not regularize the bias; must with -B 1 to have the bias; DON'T use this unless you know what it is
    (for -s 0, 2, 5, 6, 11)
-wi weight: weights adjust the parameter C of different classes (see README for details)
-v n: n-fold cross validation mode
-C : find parameters (C for -s 0, 2 and C, p for -s 11)
-q : quiet mode (no outputs)
col:
    if 'col' is setted, training_instance_matrix is parsed in column format, otherwise is in row format
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21340056

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档