EventAdditiveEffect#

pydantic model pymc_marketing.mmm.additive_effect.EventAdditiveEffect[source]#

Event effect class for the MMM.

Parameters:
df_eventspd.DataFrame
The DataFrame containing the event data.
  • name: name of the event. Used as the model coordinates.

  • start_date: start date of the event

  • end_date: end date of the event

prefixstr

The prefix to use for the event effect and associated variables.

effectEventEffect

The event effect to apply.

reference_datestr

The arbitrary reference date to calculate distance from events in days. Default is “2025-01-01”.

date_dim_namestr

The name of the date dimension in the model. Default is “date”.

Methods

EventAdditiveEffect.__init__(**data)

Create a new model by parsing and validating input data from keyword arguments.

EventAdditiveEffect.create_data(mmm)

Create the required data in the model.

EventAdditiveEffect.create_effect(mmm)

Create the event effect in the model.

EventAdditiveEffect.from_dict(data)

Reconstruct from a dict via Pydantic model_validate.

EventAdditiveEffect.set_data(mmm, model, X)

Set the data for new predictions.

EventAdditiveEffect.to_dict([_orig])

Serialize to a dict via Pydantic model_dump.

field date_dim_name: str = 'date'[source]#
field df_events: Annotated[DataFrame, InstanceOf()] [Required][source]#
field effect: EventEffect [Required][source]#
field prefix: str [Required][source]#
field reference_date: str = '2025-01-01'[source]#