|
• 5-Fold Cross-Validation
Do you understand how k-fold cross-validation works?
Split the data 'k' ways- if the observations are in matrix rows. It is easy in MATLAB to randomly assign rows to 1 of 'k' groups, using 'rand'.
Then, rotate through all 'k' groups, each time building a model on everyone except group 'k', and test group 'k'. In MATLAB, use something like:
for i = 1:k,
% Train on:
DATA(find(GROUP ~= i),:)
% Test on:
DATA(find(GROUP == i),:)
end
At the end, aggregate test results and summarize.
-Predictor
http://will.dwinnell.com
|