我使用matlabsequentialfs函数进行前向特征选择,代码如下。我多次重复运行相同的代码,我注意到结果大不相同。虽然每次运行的交叉验证不同(折叠数相同),但我认为选择的特征应该大致相同。有人可以帮忙解释一下吗?谢谢。
cp = cvpartition(label,'k',cvNum); % Stratified cross-validation
opts = statset('display','iter');
fun = @(XT,yT,Xt,yt)...
(sum(yt ~= SVCpredict(Xt,yt,XT,yT)));
[fs,history] = sequentialfs(fun,data,label,'cv',cp,'options',opts);