SoftmaxWeightedSumFitter.score_from_prediction#

SoftmaxWeightedSumFitter.score_from_prediction(pp, y)#

Compute the Bayesian \(R^2\) from an already-sampled posterior predictive.

Reuses a prediction that has already been drawn (e.g. via predict()) instead of resampling the posterior predictive distribution, which score() would otherwise trigger internally.

Parameters:
  • pp (InferenceData) – Posterior predictive draws containing a mu variable with a treated_units dimension, as returned by predict().

  • y (DataArray) – Observed targets to score against the posterior predictive mean.

Return type:

Series