secondmind-labs / trieste

A Bayesian optimization toolbox built on TensorFlow
Apache License 2.0
212 stars 42 forks source link

Plotting a partial dependance corner plot (like scikit-optimize) #806

Open avivajpeyi opened 6 months ago

avivajpeyi commented 6 months ago

Describe the feature you'd like A potentially useful plot for diagnostics is the partial dependence 'corner' or 'triangle' plot of the model prediction in the various 1d/2d marginal views, as done in the scikit-optimize library

sphx_glr_partial-dependence-plot_001

This shows the partial dependence of the model output with the various model input parameters, and may help visualise/diagnose the progress the optimizer.

Describe alternatives you've considered I've attempted at using corner.py to achieve the above in a hacky approach (by using the GP model mean value as 'weights'):

1. plot_samples = search_space.sample(N)
2. weights, _ = model.predict(plot_samples)
3. corner(plot_samples, weights=weights/max(weights))
Screenshot 2024-01-11 at 12 43 15 pm

this kindof works, but isn't the ideal solution -- the 2d and 1d contours can be made to be smooth if we plot the partial dependence of the model for each parameter rather than plotting samples weighted by the model output.

Would this be something that could be interesting to add as an 'experimental plottting' feature?