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

9 visualizaciones (últimos 30 días)
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 comentarios
Alan Weiss
Alan Weiss el 15 de Nov. de 2020
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 el 15 de Nov. de 2020
Hi I want to maximize a customised accuracy definition from the model given by the fitcensemble

Iniciar sesión para comentar.

Respuestas (1)

Alan Weiss
Alan Weiss el 17 de Nov. de 2020
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

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by