How to get trained GP model from Service API for predictions and plotting
See original GitHub issuehi,
i m trying to train a basic 1d GP on data from an excel sheet and then continue with .get_next_trial()
(and plot after each iteration).
ax_client = AxClient()
ax_client.create_experiment(name=..., parameters=..., objective_name=..., minimize=True)
for _, row in df.iterrows():
# format parameters and result
p, trial_index = ax_client.attach_trial(parameters)
ax_client.complete_trial(trial_index=trial_index, raw_data=result)
However, prediction and plotting is not possible, as ax_client.get_best_parameters()
is giving ax.service.utils.best_point: Could not use model predictions to identify best point, will use raw objective values.
and feeding ax_client.generation_strategy.model
into render(...)
gives NotImplementedError: RandomModelBridge does not support prediction.
A look at ax_client.generation_strategy.model
shows None
.
I can set up a model via model = get_GPEI(ax_client.experiment, ax_client.experiment.lookup_data())
, which then can be plotted (and shows correct data).
How can I run the service api on a pre-trained GP and from there do standard bayesian optimization with model update?
best regards
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
So
ax_client.generation_strategy.model
gets setafter
the first call toax_client.get_next_trial()
. If you reverse the order of operations to the following, your example should work:hi!
thanks a lot for the A+ clarification. The changed order now has the hoped for / expected behaviour 😃