nfcvreg.m

来自「各种SVM分类算法」· M 代码 · 共 22 行

M
22
字号
function [xapp,yapp,xtest,ytest]=nfcvreg(x,y,N,k)

% USAGE
% [xapp,yapp,xtest,ytest]=nfcvnoprior(x,y,N,k)
% N-fold crossvalidation
% k indicates the portion to leave out for test
%
nbdata=length(y);
Nportion=round(nbdata/N);

if k~=N
indtest=Nportion*(k-1)+1:Nportion*k;
else
    indtest=Nportion*(k-1)+1:nbdata;
end;
indapp=setxor(1:nbdata,indtest);
xapp=x(indapp,:);
xtest=x(indtest,:);
yapp=y(indapp);
ytest=y(indtest);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?