1

I have a problem with the K fold cross validation in Matlab, actually I have used the function mentioned here. The problem is that I get different Cp values every time I run my program. I use the function to perform a feature selection procedure so I get a different subset feature every time. Could you please help me to find a solution or to identify the problem source?

Community
  • 1
  • 1
Tarek
  • 11
  • 1

1 Answers1

1

crossvalind randomly generates cross validation indexes, so this will be a non-deterministic process. That's the source of your problem, but it is not unexpected.

The solution would be to save the training and testing sample indexes used for our feature selection.

chappjc
  • 30,359
  • 6
  • 75
  • 132