【问题标题】:Performing regression using LIBSVM in Matlab在 Matlab 中使用 LIBSVM 执行回归
【发布时间】:2013-08-08 12:05:55
【问题描述】:

我正在研究多元时间序列估计。我不太确定 LIBSVM 是否这样做。如何解决基本的单变量线性问题?

假设我有 x = [1990,1991,1992,1993,1994] 和 y = [1,2,3,4,5]。现在我想在 Matlab 中使用 LIBSVM 预测 testx = 1995 的值。我尝试使用工具箱,但得到的结果是

model = svmtrain(y,x,'-s 3 -t 0 -c 1 -p 0.1');
*
optimization finished, #iter = 0
nu = 0.000000
obj = 0.000000, rho = -1.000000
nSV = 0, nBSV = 0
>> TST = 6;
[predicted_label, accuracy, prob_estimates]=svmpredict(TST,testx,model);
Mean squared error = 25 (regression)
Squared correlation coefficient = -1.#IND (regression) 

这里发生了什么?由于我给出的数据是线性的,我选择了 -t 0 这是线性内核。

【问题讨论】:

  • 您能否解释一下,您的选项字符串 ('-s 3 -t 0 -c 1 -p 0.1') 与 documentation on svmtrain 所说的内容有何关联?你在哪里发现-t 0 是一个线性核?
  • @Schorsch 你引用的函数来自统计工具箱,not libsvm的matlab接口,不幸的是,默认情况下也称为svmtrain
  • @AllIsWell 两件事(1)您没有显示 svmpredict 的输出(例如predicted_label),因此很难基于此提供帮助以及(2)您没有将数据建模为时间序列,而不是单变量回归。
  • @Schorsch 您好,感谢您的回复。作者文档可以参考csie.ntu.edu.tw/~cjlin/libsvm
  • @MarcClaesen 你好,马克。感谢您的回复,我为该输入得到的 predict_label 为 1 且准确度 = [0;25;NaN]

标签: matlab machine-learning regression libsvm


【解决方案1】:

我终于弄清楚出了什么问题。我通过的输入是一个行向量。 Libsvm 以列向量格式接受输入。 x 应该是 m*n,其中 m 是数据数,n 是特征数,y 是列标签向量。 感谢 Sriram 帮助我解决了这个问题。

【讨论】:

    猜你喜欢
    • 2013-05-25
    • 2013-12-21
    • 2012-07-20
    • 2012-01-23
    • 2013-03-11
    • 2020-09-10
    • 2019-07-11
    • 2013-08-20
    • 2016-02-06
    相关资源
    最近更新 更多