%说明:下面是我自己写的matlab代码,其实matlab有自带的交叉验证代码crossvalind,见Chunhou Zheng师兄的Metasample Based Sparse Representation for Tumor提供的代码
%说明:Main_gene10FOLD_1.m有,用法非常简单,和自己编写的实现的是同样的功能
% 10-fold cross validation
%This code is written by Gui Jie in the afternoon 2009/06/08.
%If you have find some bugs in the codes, feel free to contract me
% Reference:
%1. Algorithm 2 of "Shuiwang Ji and Jieping Ye. Generalized Linear Discriminant Analysis: A
% Unified Framework and Efficient Model Selection. IEEE Transactions on Neural Networks.
% Vol. 19, No. 10, pp. 1768-1782, 2008."
%2.Foot note 4 of "F.Wang,et al.,marginFace:A novel face recognition method by average neighborhood
% margin maximization,Pattern Recognition (2009)"
v=10;% If v=4,it means 4-fold cross validation.
step=floor(size(fea_train,1)/v);
for j =1:v
if j~= v
&nb
交叉验证代码(matlab code of cross validation)
最新推荐文章于 2025-06-16 14:25:54 发布