lightweight_mmm
lightweight_mmm copied to clipboard
budget change tracking
Hi Team,
when we use a find_optimal_budgets, how to get the past budget for the n_time_periods vs the newly selected/given budget
Hi @virithavanama ,
You could refer to the optimization section (starting from cell 26) in the example notebook. Specifically you could find calculations of previous budget allocation and optimal budget allocation in cell 28 and cell 29.
Note: find_optimal_budges performs optimization across the n_time_periods and under the same budget bound of your choice.
This gives the new budget split old vs new but what I want is for the given period( eg: 52 weeks), what is the previous mean budget for the model?
Hi, @virithavanama. Thanks for clarifying the question. would cell 27 in example notebook help?
If you are interested in how the package calculates previous media. You could dig into optimize_media.py. line 131, line 172, and line 179 .
The package has a few assumptions for future budget optimization. Generally speaking, previous budget = previous impressions * previous prices.
im accessing the saved model, and want to extract historical budget from the model
I would detour you to the lightweightmmm class to check saved attributes in the model object or the documentation page: https://lightweight-mmm.readthedocs.io/en/latest/api.html#lightweightmmm-object
Unfortunately, saved model object does not have a method to output historical budget. You'll have to code a bit. You'll also need to make a few assumptions to carry out the calculations.
We will keep an eye on similar asks regarding historical budget. If this is common, we should consider add it to the package.
Yes please keep this in the queue because this will help in comparing the budget change similar to the previous and optimized channel-wise split and conversions change