CounterfactualSweep#
- class pymc_marketing.mmm.marginal_effects.CounterfactualSweep(mmm, X, predictors, sweep_values, sweep_type='multiplicative')[source]#
CounterfactualSweep class is used to perform counterfactual analysis on MMM’s.
Methods
CounterfactualSweep.__init__
(mmm, X, ...[, ...])Initialize and run the counterfactual sweep.
Compute marginal effects via finite differences from the sweep results.
Apply the intervention to the predictors.
Plot the marginal effects curve.
CounterfactualSweep.plot_uplift
([hdi_prob, ax])Plot the counterfactual uplift curve.
Run the model's predict function over the sweep grid and store results.