How to best do cross-validation using fitensemble?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Tobias Pahlberg
il 23 Giu 2016
Risposto: Don Mathis
il 31 Mar 2017
Hi
I generated code from the Classification Learner app where I wanted to cross-validate a classifier. It gave me something like:
classificationEnsemble = fitensemble(predictors, response, Bag', nRounds, Tree', type', 'Classification', ...);
partitionedModel = crossval(classificationEnsemble, 'KFold', 5);
But I can also provide the cross-validation parameter directly into the fitensemble command. Like:
classificationEnsemble = fitensemble(..., 'KFold', 5);
Is there any difference here? Is the first case trained on all the data and then cross-validated??
/Thanks
0 Commenti
Risposta accettata
Don Mathis
il 31 Mar 2017
It doesn't make any difference in the models. The only difference is that with the first method you also get a single model trained on the full dataset.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Classification Learner App in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!