candle.viz_utils.plot_calibration_interpolation

candle.viz_utils.plot_calibration_interpolation#

candle.viz_utils.plot_calibration_interpolation(mean_sigma, error, splineobj1, splineobj2, method='', figprefix=None, steps=False)#

Functionality to plot empirical calibration curves estimated by interpolation of the computed standard deviations and errors. Since the estimations are very noisy, two levels of smoothing are used. Both can be plotted independently, if requested. The plot(s) generated is(are) stored in png file(s).

Parameters:
  • mean_sigma (numpy array) – Array with the mean standard deviations computed in inference.

  • error (numpy array) – Array with the errors computed from the means predicted in inference.

  • splineobj1 (scipy.interpolate python object) – A python object from scipy.interpolate that computes a cubic Hermite spline (PchipInterpolator) to express the interpolation after the first smoothing. This spline is a partial result generated during the empirical calibration procedure.

  • splineobj2 (scipy.interpolate python object) – A python object from scipy.interpolate that computes a cubic Hermite spline (PchipInterpolator) to express the mapping from standard deviation to error. This spline is generated for interpolating the predictions after a process of smoothing-interpolation-smoothing computed during the empirical calibration procedure.

  • method (string) – Method used to comput the standard deviations (i.e. dropout, heteroscedastic, etc.).

  • figprefix (string) – String to prefix the filename to store the figure generated. A ‘_empirical_calibration_interpolation.png’ string will be appended to the figprefix given.

  • steps (bool) – Besides the complete empirical calibration (including the interpolating spline), also generates partial plots with only the spline of the interpolating spline after the first smoothing level (smooth1).