lightweight_mmm icon indicating copy to clipboard operation
lightweight_mmm copied to clipboard

budget change tracking

Open virithavanama opened this issue 2 years ago • 6 comments

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

virithavanama avatar Jan 17 '23 15:01 virithavanama

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.

statm3n avatar Jan 23 '23 05:01 statm3n

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?

virithavanama avatar Jan 23 '23 14:01 virithavanama

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.

statm3n avatar Jan 23 '23 15:01 statm3n

im accessing the saved model, and want to extract historical budget from the model

virithavanama avatar Jan 23 '23 15:01 virithavanama

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.

statm3n avatar Jan 23 '23 16:01 statm3n

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

virithavanama avatar Jan 23 '23 19:01 virithavanama