MuEffect#

class pymc_marketing.mmm.additive_effect.MuEffect[source]#

Abstract base class for arbitrary additive mu effects.

All mu_effects must inherit from this Pydantic BaseModel to ensure proper serialization and deserialization when saving/loading MMM models.

Methods

MuEffect.__init__(**data)

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

MuEffect.check_lift_tests(mmm, df_lift_test)

Warn if lift tests added to the MMM overlap data this effect uses.

MuEffect.check_scenario_use(mmm)

Warn if this effect misreads the placeholder spend of budget scenarios.

MuEffect.construct([_fields_set])

MuEffect.copy(*[, include, exclude, update, ...])

Returns a copy of the model.

MuEffect.create_data(mmm)

Create the required data in the model.

MuEffect.create_effect(mmm)

Create the additive effect in the model.

MuEffect.dict(*[, include, exclude, ...])

MuEffect.from_dict(data)

Reconstruct from a dict via Pydantic model_validate.

MuEffect.from_orm(obj)

MuEffect.idata_groups()

Return supplementary data groups to store in DataTree.

MuEffect.incrementality_spec()

Opt this effect in to spend-counterfactual incrementality analysis.

MuEffect.json(*[, include, exclude, ...])

MuEffect.model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

MuEffect.parse_file(path, *[, content_type, ...])

MuEffect.parse_obj(obj)

MuEffect.parse_raw(b, *[, content_type, ...])

MuEffect.schema([by_alias, ref_template])

MuEffect.schema_json(*[, by_alias, ref_template])

MuEffect.set_data(mmm, model, X)

Set the data for new predictions.

MuEffect.to_dict()

Serialize to a dict via Pydantic model_dump.

MuEffect.update_forward_refs(**localns)

MuEffect.validate(value)

Attributes

MuEffect.contribution_var_name

Name of the posterior deterministic holding this effect's contribution.

MuEffect.model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].