plot_contour#
- AxModelManager.plot_contour(param_x=None, param_y=None, metric_name=None, slice_values='mid', n_points=200, range_x=None, range_y=None, mode='mean', cbar_location='top', show_trials=True, show_contour=True, show_contour_labels=False, subplot_spec=None, gridspec_kw=None, pcolormesh_kw=None, **figure_kw)#
Plot a 2D slice of the surrogate model.
- Parameters:
- param_xstr
Name of the parameter to plot in x axis.
- param_ystr
Name of the parameter to plot in y axis.
- metric_namestr, optional.
Name of the metric to plot. If not specified, it will take the first objective in
self.ax_client.- slice_valuesdict or str, optional.
The values along which to slice the model, if the model has more than two dimensions. Possible values are:
"best"(slice along the best predicted point),"mid"(slice along the middle point of the varying parameters), or a dictionary with structure{param_name: param_val}that contains the slice values of each parameter. By default,"mid".- n_pointsint, optional
Number of points in each axis. By default,
200.- range_x, range_ylist of float, optional
Range of each axis. It not given, the lower and upper boundary of each parameter will be used.
- modestr, optional.
Whether to plot the
"mean"of the model, the standard error of the mean"sem", or"both". By default,"mean".- cbar_locationstr, optional.
Set position of the colorbar. By default,
"top".- show_trialsbool
Whether to show the trials used to build the model. By default,
True.- show_contourbool
Whether to show the contour lines. By default,
True.- show_contour_labelsbool
Whether to add labels to the contour lines. By default,
False.- subplot_specSubplotSpec, optional
A matplotlib
SubplotSpecin which to draw the axis.- gridspec_kwdict, optional
Dict with keywords passed to the
GridSpec.- pcolormesh_kwdict, optional
Dict with keywords passed to
ax.pcolormesh.- **figure_kw
Additional keyword arguments to pass to
pyplot.figure. Only used if nosubplot_specis given.
- Returns:
- Figure, Axes or list of Axes
A matplotlib figure and either a single
Axesor a list ofAxesifmode="both".