【发布时间】: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 onsvmtrain所说的内容有何关联?你在哪里发现-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