使用LIBSVM在MATLAB中预测整个测试集的相同值

时间:2017-01-18 06:27:40

标签: matlab libsvm

我在libsvm包中使用支持向量回归(SVR)来预测输出。内核:RBF

火车套装尺寸:729x40 测试集大小:137x40

根据实际情况衡量,火车组的输出似乎很好。但是对测试集的预测都是一样的。它输出相同的值。

检查相关帖子后,我将数据标准化并使用gamma值(10-100000)进行播放,但问题仍然存在。

trainGT=games(((games(:,46)>=2010) & (games(:,46)<2015) & (games(:,1)~=8)),43);
featuresTrain=lastGame(games,true,1);
testGT=games((games(:,46)>=2015 & (games(:,1)~=8)),43);
featureTest=lastGame(games,false,1);  
eval(['model = svmtrain( trainGT, featuresTrain,''-s 4 -t 2 -c 10 -g 10 '  ''');']);
w = (model.sv_coef' * full(model.SVs));
b = -model.rho;

predictionsTrain = svmpredict(trainGT, featuresTrain,model); 
predictionsTest = svmpredict(zeros(length(testGT),1), featureTest, model);

我的输出如下

optimization finished, #iter = 1777
epsilon = 0.630588
obj = -19555.036253, rho = -17.470386
nSV = 681, nBSV = 118
Mean squared error = 305.214 (regression)
Squared correlation coefficient = -1.#IND (regression)

我的所有predictionTest值都是17.4704(与输出中的rho值相同)。有人可以帮我这个吗?感谢。

0 个答案:

没有答案