svroutput.m
资源名称:svm.zip [点击查看]
上传用户:xfjled
上传日期:2007-05-06
资源大小:150k
文件大小:1k
源码类别:
matlab例程
开发平台:
Matlab
- function tstY = svroutput(trnX,tstX,ker,beta,bias)
- %SVRMSE Calculate SVR Output
- %
- % Usage: tstY = svroutput(trnX,tstX,ker,beta,bias)
- %
- % Parameters: trnX - Training inputs
- % tstX - Test inputs
- % ker - kernel function
- % beta - Difference of Lagrange Multipliers
- % bias - bias
- % comp - sparse components
- %
- % Author: Steve Gunn (srg@ecs.soton.ac.uk)
- if (nargin ~= 5) % check correct number of arguments
- help svroutput
- else
- n = size(trnX,1);
- m = size(tstX,1);
- H = zeros(m,n);
- for i=1:m
- for j=1:n
- H(i,j) = svkernel(ker,tstX(i,:),trnX(j,:));
- end
- end
- tstY = (H*beta +bias);
- end