mse
1 n
n
f xi
i1
yi 2
n
n
n
(n xiyi xi • yi )2
r2
i1
i1
i1
n
n i1
xi2
n i1
xi
2
n
n i1
yi2
n i1
yi
2
2015年2月3日
回归列子
X=-1:0.1:1
Y=-x.^2;
0
-0.1
-0.2
-0.3
-0.4
-0.5
[predctlabel,accuracy]=svmpredict(test datalabel,testdata,model);
2015年2月3日
data = 176 70 180 80 161 45 163 47 label = 1 1 -1 -1 testdata = 190 85 161 50 testdatalabel = 1 1 Accuracy = 50% (1/2) (classification) (无用) predctlabel = 1 -1 accuracy = 50 2015年2月3日 NaN
-0.6
-0.7
-0.8
-0.9
-1
-1 -0.8 -0.6 -0.4 -0.2
0
0.2 0.4 0.6 0.8
1
2015年2月3日
model = svmtrain(y,x,'-s 3 -t 2 -c 2.2 -g 2.8 -p 0.01');
[py,mse] = svmpredict(y,x,model); figure; subplot(3,1,1) plot(x,y,'o'); title(‘原始数据'); hold on; plot(x,py,'r*'); subplot(3,1,2) plot(x,py,'r*');