MATLAB Answers


Validation Accuracy is changing when the same classifier is trained on the same data

Asked by Mortada Haidar on 19 Jan 2017
Latest activity Commented on by Walter Roberson
on 19 Jan 2017
Hello. I am using ensemble classifiers in the Matlab Classification Learner. The problem is that I am getting different accuracies when training the same classifier (Bagged Trees) on the same data.


Sign in to comment.

1 Answer

Answer by Walter Roberson
on 19 Jan 2017
 Accepted Answer

Most of the classifiers include random initialization. To repeat the same accuracy with the same classifier on the same data, set the random number seed each time, using rng()


Ok I see. But then how can I assess the performance of my model? Validation accuracy is changing drastically when changing the seed..
In such a case you have to assume that there is a lot of over-fitting. Reduce the size of your training set and increase the size of your test set.

Sign in to comment.