MATLAB: Classification Learner gives different results every time

classificationcross-validationleanerMATLAB

If run the classifications learner, get the results, close down the classification learner, immediately open up classification learner again (same data is kept in the work-space, nothing has changed or reloaded), and run the classification again. Why are different results yielded?

Best Answer

The reason for the different results is by using k-fold cross-validation method.
When starting a new session in the Classification Learners App, the default validation method under the 'Step 3' section is 5 folds cross-validation.
This means that MATLAB will randomly partition all of the selected data into 5 equally sized sub-samples. Then it uses 4 partitions to train a model and use the 1 partition left for testing/validation.
The cross-validation process is then repeated 5 times, with each of the 5 sub-samples used exactly once as the validation data.
Therefore, when starting a new session each time, the data will be randomly partitioned into different sub-samples and will have different results.
Refer to the following link for more information on selecting validation method in MATLAB: