フィルターのクリア

How to best do cross-validation using fitensemble?

1 回表示 (過去 30 日間)
Tobias Pahlberg
Tobias Pahlberg 2016 年 6 月 23 日
回答済み: Don Mathis 2017 年 3 月 31 日
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

採用された回答

Don Mathis
Don Mathis 2017 年 3 月 31 日
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 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by