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_columnstr

Column name of the date variable.

channel_columnsList[str]

Column names of the media channel variables.

adstock_max_lagint, optional

Number of lags to consider in the adstock transformation, by default 4

adstockstr | AdstockTransformation

Type of adstock transformation to apply.

saturationstr | SaturationTransformation

Type of saturation transformation to apply.

time_varying_interceptbool, optional

Whether to consider time-varying intercept, by default False. Because the time-varying variable is centered around 1 and acts as a multiplier, the variable baseline_intercept now 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-media creates 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_configDictionary, optional

dictionary of parameters that initialise model configuration. Class-default defined by the user default_model_config method.

sampler_configDictionary, 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_columnsOptional[List[str]], optional

Column names of control variables to be added as additional regressors, by default None

yearly_seasonalityOptional[int], optional

Number of Fourier modes to model yearly seasonality, by default None.