MMM.__init__#
- MMM.__init__(date_column, channel_columns, adstock_max_lag, adstock, saturation, time_varying_intercept=False, time_varying_media=False, model_config=None, sampler_config=None, validate_data=True, control_columns=None, yearly_seasonality=None, adstock_first=True, **kwargs)#
Constructor method.
- Parameters:
- date_column
str Column name of the date variable.
- channel_columns
List[str] Column names of the media channel variables.
- adstock_max_lag
int, optional Number of lags to consider in the adstock transformation, by default 4
- adstock
str|AdstockTransformation Type of adstock transformation to apply.
- saturation
str|SaturationTransformation Type of saturation transformation to apply.
- time_varying_interceptbool, optional
Whether to consider time-varying intercept, by default False. Because the
time-varyingvariable is centered around 1 and acts as a multiplier, the variablebaseline_interceptnow represents the mean of the time-varying intercept.- time_varying_mediabool, optional
Whether to consider time-varying media contributions, by default False. The
time-varying-mediacreates a time media variable centered around 1, this variable acts as a global multiplier (scaling factor) for all channels, meaning all media channels share the same latent fluctiation.- model_config
Dictionary, optional dictionary of parameters that initialise model configuration. Class-default defined by the user default_model_config method.
- sampler_config
Dictionary, optional dictionary of parameters that initialise sampler configuration. Class-default defined by the user default_sampler_config method.
- validate_databool, optional
Whether to validate the data before fitting to model, by default True.
- control_columns
Optional[List[str]], optional Column names of control variables to be added as additional regressors, by default None
- yearly_seasonality
Optional[int], optional Number of Fourier modes to model yearly seasonality, by default None.
- date_column