How does the classification learner app implement k-fold cross validation?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
Does anyone know how the k-fold cross validation is implemented in the classification learner app? Specifically, does it automatically stratify the folds?
Thanks
James
0 commentaires
Réponse acceptée
the cyclist
le 21 Mar 2023
I am most definitely not an expert in this app, but I built a simple model using the default settings, and then exported the function. It has this line
% Perform cross-validation
partitionedModel = crossval(trainedClassifier.ClassificationTree, 'KFold', 5);
which suggests to me that it does not stratify by default. (The crossval function accepts a 'Stratify' Name-Value pair, which is not present here.)
I could not see a way to specify this in the app itself, but maybe there is. You could contact support to find out, if you don't get an answer here.
2 commentaires
the cyclist
le 21 Mar 2023
Ah, I see that whether crossval stratifies by default or not is dependent on the nature of the first argument (just a number, or the group).
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Classification Learner App dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!