rail.core.point_estimation module

class rail.core.point_estimation.PointEstimationMixin[source]

Bases: object

calculate_point_estimates(qp_dist, grid=None)[source]

This function drives the calculation of point estimates for qp.Ensembles. It is defined here, and called from the _process_chunk method in the CatEstimator child classes.

Parameters:
  • qp_dist (qp.Ensemble) – The qp Ensemble instance that contains posterior estimates.

  • grid (array-like, optional) – The grid on which to evaluate the point estimate. Note that not all point estimates require a grid to be provided, by default None.

Returns:

The original qp.Ensemble with new ancillary point estimate data included. The Ensemble.ancil keys are [‘mean’, ‘mode’, ‘median’].

Return type:

qp.Ensemble

Notes

If there are particularly efficient ways to calculate point estimates for a given CatEstimator subclass, the subclass can implement any of the _calculate_<foo>_point_estimate for any of the point estimate calculator methods, i.e.:

  • _calculate_mode_point_estimate

  • _calculate_mean_point_estimate

  • _calculate_median_point_estimate