How to optimize hyperparameters for fitcensemble using a customized maximize function?

조회 수: 9 (최근 30일)
Hi, I have been using fitcensemble method to minimize objective function by default, as I can get the minimum objective result from mdl, which is a ClassificationEnsemble
mdl = fitcensemble(XTrain,yTrain,...
'OptimizeHyperparameters',auto,...
'Learners',template, ...
'HyperparameterOptimizationOptions',hyperoptsOptions,...
'ScoreTransform','logit',...
'CategoricalPredictors', isCategoricalPredictor,...
'PredictorNames', predictorNames);
minObj = mdl.HyperparameterOptimizationResults.MinObjective;
Is it possible to get a customized maximize function from fitcensemble function?. If yes, could you provide me an example please?
Thank you
  댓글 수: 2
Alan Weiss
Alan Weiss 2020년 11월 15일
I do not understand what you are trying to do. fitcensemble tries to fit a classification ensemble by minimizing an error. What sense would it make to maximize an error?
Alan Weiss
MATLAB mathematical toolbox documentation
Yean Lim
Yean Lim 2020년 11월 15일
Hi I want to maximize a customised accuracy definition from the model given by the fitcensemble

댓글을 달려면 로그인하십시오.

답변 (1개)

Alan Weiss
Alan Weiss 2020년 11월 17일
I am not sure, but maybe you can use the fitcensemble 'Cost' name-value argument. Give the negative of your customized accuracy measure in order that fitcensemble will look for a maximum. Or maybe give a constant minus the customized accuracy where you choose the constant so that the cost will always be positive, but not too large so that the differences still matter.
Alan Weiss
MATLAB mathematical toolbox documentation

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by