EventAdditiveEffect#
- class pymc_marketing.mmm.additive_effect.EventAdditiveEffect(**data)[source]#
Event effect class for the MMM.
- Parameters:
- df_events
pd.DataFrame - The DataFrame containing the event data.
name: name of the event. Used as the model coordinates.start_date: start date of the eventend_date: end date of the event
- prefix
str The prefix to use for the event effect and associated variables.
- effect
EventEffect The event effect to apply.
- reference_date
str The arbitrary reference date to calculate distance from events in days. Default is “2025-01-01”.
- date_dim_name
str The name of the date dimension in the model. Default is “date”.
- df_events
Methods
EventAdditiveEffect.__init__(**data)Create a new model by parsing and validating input data from keyword arguments.
EventAdditiveEffect.construct([_fields_set])EventAdditiveEffect.copy(*[, include, ...])Returns a copy of the model.
Create the required data in the model.
Create the event effect in the model.
EventAdditiveEffect.dict(*[, include, ...])Reconstruct from a dict via Pydantic model_validate.
EventAdditiveEffect.json(*[, include, ...])Compute the class name for parametrizations of generic classes.
EventAdditiveEffect.parse_file(path, *[, ...])EventAdditiveEffect.parse_raw(b, *[, ...])EventAdditiveEffect.schema([by_alias, ...])EventAdditiveEffect.schema_json(*[, ...])EventAdditiveEffect.set_data(mmm, model, X)Set the data for new predictions.
EventAdditiveEffect.to_dict([_orig])Serialize to a dict via Pydantic model_dump.
EventAdditiveEffect.validate(value)Attributes
end_datesThe end dates of the events.
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.
start_datesThe start dates of the events.
df_eventsprefixeffectreference_datedate_dim_name