FrequencyReachAdditiveEffect#
- class pymc_marketing.mmm.additive_effect.frequency_reach_effect.FrequencyReachAdditiveEffect(**data)[source]#
Additive mu effect from frequency & reach observations.
- Parameters:
- df_frequency_reach
pd.DataFrame Long format DataFrame with columns at least: date, channel, frequency, reach. Additional columns matching
mmm.dims(e.g. geo) are optional.- saturation
SaturationTransformation Saturation transformation applied after adstock.
- adstock
AdstockTransformation Adstock transformation applied first to the effective exposure signal.
- prefix
str, default “frequency_reach” Variable name prefix for PyMC random/deterministic vars.
- date_dim_name
str, default “date” Name of the date coordinate in the target model.
- channel_coord_name
str, default “channel” Name of the channel coordinate used by the parent model.
- df_frequency_reach
Methods
Create a new model by parsing and validating input data from keyword arguments.
FrequencyReachAdditiveEffect.copy(*[, ...])Returns a copy of the model.
Register pm.Data nodes required for the effect.
Create transformed contribution (Meridian pipeline) and return aggregate effect.
FrequencyReachAdditiveEffect.dict(*[, ...])FrequencyReachAdditiveEffect.json(*[, ...])Creates a new instance of the
Modelclass with validated data.FrequencyReachAdditiveEffect.model_copy(*[, ...])!!! abstract "Usage Documentation"
FrequencyReachAdditiveEffect.model_dump(*[, ...])!!! abstract "Usage Documentation"
!!! abstract "Usage Documentation"
Generates a JSON schema for a model class.
FrequencyReachAdditiveEffect.model_parametrized_name(params)Compute the class name for parametrizations of generic classes.
Model post initialization for a Pydantic model.
Try to rebuild the pydantic-core schema for the model.
Validate a pydantic model instance.
!!! abstract "Usage Documentation"
Validate the given object with string data against the Pydantic model.
FrequencyReachAdditiveEffect.set_data(mmm, ...)Update reach & frequency raw data for prediction dates.
Attributes
model_computed_fieldsmodel_configConfiguration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].model_extraGet extra fields set during validation.
model_fieldsmodel_fields_setReturns the set of fields that have been explicitly set on this model instance.
df_frequency_reachsaturationadstockprefixdate_dim_namechannel_coord_name