axtreme.eval.qoi_helpers

Plotting helper tailored for analysingQoIJobResults.

Functions

plot_col_histogram(df, ax[, col_name, ...])

Helper which creates a histogram (on the given ax) based on a column of the df.

plot_distribution(df, ax[, n_hists, ...])

Helperfor plotting histograms (on the given ax) of dataframe cells containing lists.

plot_groups(df_grouped, plotting_funcs)

Takes a grouped dataframe, and generates a row of plots for each group, using plotting_funcs.

qoi_ignoring_gp_uncertainty(qoi, model)

Helper to run a QoI with a model, ignoring uncertainty in the model (e.g using the posterior mean).

axtreme.eval.qoi_helpers.plot_col_histogram(df: DataFrame, ax: Axes, col_name: str = 'mean', brute_force: float | None = None) None

Helper which creates a histogram (on the given ax) based on a column of the df.

Designed for use with the ‘mean’ or ‘var’ column of a QoiJobResults dataframe.

Parameters:
  • df – A dataframe.

  • ax – The axis to plot on.

  • col_name – The column of the df containing lists.

  • brute_force – Represents the true value (e.g mean). Plots a vertical line if provided.

axtreme.eval.qoi_helpers.plot_distribution(df: DataFrame, ax: Axes, n_hists: int = 3, col_name: str = 'samples', brute_force: float | None = None) None

Helperfor plotting histograms (on the given ax) of dataframe cells containing lists.

Designed for use with the ‘samples’ column of a QoiJobResults dataframe.

Parameters:
  • df – A dataframe.

  • ax – The axis to plot on.

  • n_hists – The number of cells of column col_name to plot.

  • col_name – The column of the df containing lists.

  • brute_force – Represents the true value (e.g mean). Plots a vertical line if provided.

axtreme.eval.qoi_helpers.plot_groups(df_grouped: DataFrameGroupBy, plotting_funcs: list[Callable[[DataFrame, Axes], None]]) Figure

Takes a grouped dataframe, and generates a row of plots for each group, using plotting_funcs.

Parameters:
  • df_grouped – The groupby object to plot

  • plotting_funcs – list of plots to be generated for each group. See plot_col_histogram for an example of a plotting function.

axtreme.eval.qoi_helpers.qoi_ignoring_gp_uncertainty(qoi: GPBruteForce, model: SingleTaskGP) Tensor

Helper to run a QoI with a model, ignoring uncertainty in the model (e.g using the posterior mean).

Parameters:
  • qoi – The QoI estimator to use

  • model – The model to use

Returns:

the estimates made by the QoI using only the posterior mean of the model.