MATLAB Answers

How to write objective function for Bayesian Optimization (bayesopt)?

32 views (last 30 days)
Eric
Eric on 23 Feb 2020
Commented: Alan Weiss on 2 Mar 2020
Dear all,
I am using `bayesopt` method and I need to provide an objective function.
I have studied the https://uk.mathworks.com/help/stats/bayesian-optimization-objective-functions.html on how to write an objective function.
Where can I find more example of objective function in MATLAB?
Can anyone guide me how to write objective function for Bayesian Optimization?
Thank you

Answers (1)

Alan Weiss
Alan Weiss on 25 Feb 2020
There is an example here:
The link you provided really has the information you need to write an objective function. Your objective takes the table that MATLAB passes, and returns a real scalar value as the objective. The fields in the table are the optimization variables. In the example, the optimization variables are box and sigma, and the function works with x.box and x.sigma.
If you want to provide pseudocode for your objective, maybe we can help you turn it into the correct form.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 Comments
Alan Weiss
Alan Weiss on 2 Mar 2020
I recently learned that there is an existing documentation example on this subject:
The following example shows exactly how to write the objective function for cross-validation loss:
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by