MMM.create_optimization_model#

MMM.create_optimization_model(start_date, end_date)[source]#

Return a PyMC model configured for the given optimization window.

Builds a zero-spend dataset over [start_date, end_date] (at the model’s own date frequency) and transforms it using the same preprocessing pipeline as sample_posterior_predictive(). The resulting model has channel_data set to zeros of the correct shape and can be passed directly to BudgetOptimizer.

Parameters:
start_datestr or pd.Timestamp

First date of the optimization window (inclusive).

end_datestr or pd.Timestamp

Last date of the optimization window (inclusive).

Returns:
pymc.Model

A cloned PyMC model ready for budget optimization.