ammm Core Mixins: Optimization (optimization.py)¶
This module provides the OptimizationMixin class, designed to be inherited by Marketing Mix Model (MMM) classes in ammm. It offers experimental methods for analysing channel response curves and optimising budget allocation across channels to maximise expected contribution, based on the fitted model parameters and estimated saturation functions.
MagicMock is a subclass of Mock with default implementations of most of the magic methods. You can use MagicMock without having to configure the magic methods yourself.
If you use the spec or spec_set arguments then only magic methods that exist in the spec will be created.
Attributes and the return value of a MagicMock will also be MagicMocks.
(Private helper method _estimate_budget_contribution_fit is used internally for estimating contribution bounds, likely for plotting purposes not directly exposed in this mixin.)