How to best do cross-validation using fitensemble?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Learner App에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!