doenut.plot

doenut.plot

Provides graph plotting functions for DoeNut

Module Contents

Functions

clear_figure()

Wrapper for matplotlib clear figure to avoid imports elsewhere

replicate_plot(inputs, responses, key)

Plots a replicate plot which shows all experiments

plot_observed_vs_predicted(responses, predictions[, ...])

plots a graph duh

plot_summary_of_fit_small(R2, Q2)

Plots a nice graph of R2 and Q2

coeff_plot(coeffs, labels[, errors, normalise])

Coefficient plot

four_D_contour_plot(unscaled_model, x_key, y_key, ...)

This could be improved to take any number of data

plot_training(R2_over_opt, Q2_over_opt, n_terms_over_opt)

Plots optimisation correlation coefficient outcomes

Attributes

logger

doenut.plot.logger
doenut.plot.clear_figure()[source]

Wrapper for matplotlib clear figure to avoid imports elsewhere

doenut.plot.replicate_plot(inputs, responses, key)[source]

Plots a replicate plot which shows all experiments and identifies the replicates inputs: responses: key: column in responses that you wish to plot

Parameters:
  • inputs

  • responses

  • key

doenut.plot.plot_observed_vs_predicted(responses, predictions, range_x=None, label='', do_axes_equal=True)[source]

plots a graph duh range should be in the form [min_x, max_x] else it will take from responses

Parameters:
  • responses

  • predictions

  • range_x – (Default value = None)

  • label – (Default value = “”)

  • do_axes_equal – (Default value = True)

doenut.plot.plot_summary_of_fit_small(R2, Q2)[source]

Plots a nice graph of R2 and Q2

Parameters:
  • R2

  • Q2

doenut.plot.coeff_plot(coeffs, labels, errors='std', normalise=False)[source]

Coefficient plot set error to ‘std’ for standard deviation set error to ‘p95’ for 95th percentile ( approximated by 2*std)

Parameters:
  • coeffs

  • labels

  • errors – (Default value = “std”)

  • normalise – (Default value = False)

doenut.plot.four_D_contour_plot(unscaled_model, x_key, y_key, c_key, x_limits, y_limits, constants, n_points, my_function, fig_label='', input_selector=None, x_label='', y_label='', constant_label='', z_label='', cmap='jet', num_of_z_levels=9, z_limits=None, tidy_subfig_axes=False)[source]

This could be improved to take any number of data 1. unscaled_model: the model you just trained 2. x_key: name in the dataframe for the input to go on the x-axis 3. y_key: name in the dataframe for the input to go on the y-axis 4. c_key: name in the dataframe for the input to be the constant for each plot (i.e. equivalents of pyrollidine) 5. x_limits: limits of the x-axis: min and max time values 6. y_limits: limits of the y-axis: min and max temperatures 7. constants: values of pyrollidine to keep constant for the 3 plots 8. n_points: how many points in the x and y direction to use to build the map 9. my_function: a little function to add higher order terms if the model requires it 10. fig_label: label for the overall figure 11. x_label: label for x-axes 12. y_label: label for y-axis 13. constant_label: label for top of subplots 14: z_label: label for the heatbar 15: cmap: colourmap for the plot (yes you can change it, do not spend hours playing around with the colourscheme!) 16: num_of_z_levels: number of levels for the contours. You will want one more than you think you do 17: z_limits: limits for the yield, i.e. minimum and maximum.

Parameters:
  • unscaled_model

  • x_key

  • y_key

  • c_key

  • x_limits

  • y_limits

  • constants

  • n_points

  • my_function

  • fig_label – (Default value = “”)

  • input_selector – (Default value = None)

  • x_label – (Default value = “”)

  • y_label – (Default value = “”)

  • constant_label – (Default value = “”)

  • z_label – (Default value = “”)

  • cmap – (Default value = “jet”)

  • num_of_z_levels – (Default value = 9)

  • z_limits – (Default value = None)

  • tidy_subfig_axes – (Default value = False)

doenut.plot.plot_training(R2_over_opt, Q2_over_opt, n_terms_over_opt)[source]

Plots optimisation correlation coefficient outcomes n_terms_over_opt R2_over_opt: list of R2 over optimisation Q2_over_opt: list of Q2 over optimisation n_terms_over_opt: running number of terms

Parameters:
  • R2_over_opt

  • Q2_over_opt

  • n_terms_over_opt