Hyperparameter Optimization in ECOC classifier: which loss function is used?
2 次查看(过去 30 天)
显示 更早的评论
Dear, I'm training an ECOC classifier using knn as the base classifier.
I would like to use the option 'OptimizeHyperparameters','auto' to let fitcecoc apply leave one out cross validation the best Coding, NumNeighbors, distace parameters.
tknn = templateKNN();
mdlknnCecoc = compact(fitcecoc(XKnn,labelsRed, ...
'OptimizeHyperparameters','all', ...
'HyperparameterOptimizationOptions',struct( 'UseParallel',...
true,'CVPartition',c), 'Learners',tknn));
In MATLAB help I read: " The optimization attempts to minimize the cross-validation loss (error) for fitcecoc by varying the parameters."
However, which loss function is used? I found no detail about that.
0 个评论
采纳的回答
Don Mathis
2019-9-20
In this Doc section https://www.mathworks.com/help/stats/fitcecoc.html?searchHighlight=fitcecoc&s_tid=doc_srchtitle#d117e320264,
it says
"The optimization attempts to minimize the cross-validation loss (error) for fitcecoc by varying the parameters. For information about cross-validation loss in a different context, see Classification Loss. "
If you click on "Classification Loss" it tells you about the multiclass loss function.
3 个评论
Don Mathis
2019-9-20
Yes, I see that now. The answer is 'classiferror', because that's the default loss for kfoldLoss for classification models.
When optimization is used, kfoldLoss is called with its default loss to compute the cross-validated loss to be optimized. The linked-to page was actually the classification kfoldLoss page, and if you scroll up you can find where it lists its default loss. I'm sorry it's not easier to find than that.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classification Ensembles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!