VariableScaling#

class pymc_marketing.mmm.scaling.VariableScaling(**data)[source]#

Abstract base for scaling a variable.

The scaling through the dimension of 'date' is assumed and doesn’t need to be specified.

Concrete subclasses:

  • DataDerivedScaling – scale by a statistic of the data ("max" or "mean"), computed at fit time.

  • FixedScaling – use a user-supplied constant that stays the same across model refreshes.

Parameters:
dimsstr or tuple of str

The dimensions to perform the operation through ("date" is always included implicitly).

Methods

VariableScaling.__init__(**data)

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

VariableScaling.construct([_fields_set])

VariableScaling.copy(*[, include, exclude, ...])

Returns a copy of the model.

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

VariableScaling.from_dict(data)

Reconstruct from a dict via Pydantic model_validate.

VariableScaling.from_orm(obj)

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

VariableScaling.model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

VariableScaling.parse_file(path, *[, ...])

VariableScaling.parse_obj(obj)

VariableScaling.parse_raw(b, *[, ...])

VariableScaling.scaling_description()

Human-readable summary of the scaling strategy (e.g. for logging).

VariableScaling.schema([by_alias, ref_template])

VariableScaling.schema_json(*[, by_alias, ...])

VariableScaling.to_dict()

Serialize to a dict via Pydantic model_dump.

VariableScaling.update_forward_refs(**localns)

VariableScaling.validate(value)

Attributes

model_computed_fields

model_config

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

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

dims