Confused at best estimated feasible point from bayesopt?
Show older comments
Hi,
I've been trying to use bayesopt for a research problem and been getting mixed results. I decided to try it with a simple example to try and understand the algorithm better. Here's the code:
% Variables
x = optimizableVariable('x', [0, 1], 'Type', 'real');
y = optimizableVariable('y', [0, 1], 'Type', 'real');
optimisation_variables = [x, y];
% Run bayesopt
results = bayesopt(@negSumSquared, optimisation_variables, 'MaxObjectiveEvaluations', 100, ...
'IsObjectiveDeterministic', true, 'AcquisitionFunctionName', 'expected-improvement-plus');
% Objective function
function result = negSumSquared(X)
result = -(X.x^2 + X.y^2);
end
When I run this bayesopt generates the surface and produces the following output:

Best observed feasible point:
x y
_______ _______
0.99962 0.99902
Best estimated feasible point (according to models):
x y
_________ _______
0.0004718 0.99888
What's confusing me quite a lot then is the estimated best point according to models. When I run the following snippet:
X = 0:0.01:1;
Y = X;
for i = 1:length(X)
for j = 1:length(Y)
Z(i, j) = predict(results.ObjectiveFcnModel, [X(i), Y(j)]);
end
end
I can confirm that min(Z) = -2 when X = 1 and Y = 1 as I would expect. So where is bayesopt pulling its best estimated feasible point from if it is not from the objective function model, and why is it so off compared to the true solution and the fitted points?
Thanks a lot for the help,
Daniel
Accepted Answer
More Answers (0)
Categories
Find more on Classification Ensembles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!