calculate_metric_distributions#
- pymc_marketing.mmm.evaluation.calculate_metric_distributions(y_true, y_pred, metrics_to_calculate=None)[source]#
Calculate distributions of evaluation metrics for posterior samples.
- Parameters:
- y_true
npt.NDArray
|pd.Series
True values for the dataset. Shape: (date,)
- y_pred
npt.NDArray
|xr.DataArray
Posterior predictive samples. Shape: (date, sample)
- metrics_to_calculate
list
ofstr
orNone
, optional - List of metrics to calculate. Options include:
r_squared
: Bayesian R-squared.rmse
: Root Mean Squared Error.nrmse
: Normalized Root Mean Squared Error.mae
: Mean Absolute Error.nmae
: Normalized Mean Absolute Error.mape
: Mean Absolute Percentage Error.
Defaults to all metrics if None.
- y_true
- Returns: