MMMIDataWrapper.get_avg_cost_per_unit#

MMMIDataWrapper.get_avg_cost_per_unit()[source]#

Get the weighted-average cost per unit for each channel.

Computed as channel_spend.sum("date") / channel_data.sum("date"). Returns 1.0 (as a broadcast-compatible DataArray) if channel_spend is not available, making this backward compatible.

Returns:
xr.DataArray

Average cost per unit with dims (channel,) [+ custom dims].