Is it possible to change the objective function in fitctree(X​,Y,'Optimi​zeHyperpar​ameters','​auto')?

I would like to use Gmean as object function of hyperparameter optimization. I thought about creating a own kfold loss function with kfoldfun. I don't know if it is possible to pass this the created loss function to 'OptimizeHyperparameters' with a 'gridsearch' or 'randomsearch'. Is this possible in some way or do I have to code a hyperparameteroptimization on my own?
I have already figured it out how to do it with bayesopt. But I would also try a 'gridsearch' and a 'randomsearch'.
Best regards,
Jan

Answers (1)

You can't change the objective function used to optimize hyperparameters in fitctree.
However, you can do grid search and random search using bayesopt by passing 'AcquisitionFunctionName','grid' or 'AcquisitionFunctionName','random', respectively. Grid search explores the grid in a random order using sampling without replacement.

Asked:

on 24 Nov 2016

Answered:

on 8 Jan 2017

Community Treasure Hunt

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

Start Hunting!