【问题标题】:How can I Use from a variable instead of an amount for nu parameter in nu-SVM for libSVM in Matlab?如何在 Matlab 中为 libSVM 的 nu-SVM 使用变量而不是 nu 参数的数量?
【发布时间】:2015-04-12 12:58:01
【问题描述】:

如你所知,libSVM 命令是这样的:

model_nu = svmtrain(train_classset, train_dataset,'-s 1 -t 0 -n 0.5'  );

当我运行它时,一切正常。 但是我需要使用变量而不是数字来表示 nu。像这样:

nu = 0.5;
 model_nu = svmtrain(train_classset, train_dataset,'-s 1 -t 0 -n nu'  );

当我这样做时,svmtrain 函数不起作用。 那么如何在 Matlab 中 libSVM 工具箱的 svmtrain 函数中使用变量而不是数字呢?

【问题讨论】:

    标签: matlab machine-learning kernel svm libsvm


    【解决方案1】:

    您必须将数字转换为字符:

    model_nu = svmtrain(train_classset, train_dataset,sprintf('-s 1 -t 0 -n %f',nu))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-29
      • 2014-03-16
      • 2019-04-30
      • 2015-11-03
      • 2013-08-17
      • 2017-06-18
      • 2023-03-07
      • 2021-01-06
      相关资源
      最近更新 更多