DataDerivedScaling#

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

Scale by a statistic of the data, computed at fit time.

Parameters:
method"max" | "mean"

The scaling method.

dimsstr or tuple of str

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

Examples

Max-absolute scaling (default behaviour):

DataDerivedScaling(method="max", dims=())

Mean-absolute scaling across a custom dimension:

DataDerivedScaling(method="mean", dims=("country",))

Methods

DataDerivedScaling.__init__(**data)

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

DataDerivedScaling.construct([_fields_set])

DataDerivedScaling.copy(*[, include, ...])

Returns a copy of the model.

DataDerivedScaling.dict(*[, include, ...])

DataDerivedScaling.from_dict(data)

Reconstruct from a dict via Pydantic model_validate.

DataDerivedScaling.from_orm(obj)

DataDerivedScaling.json(*[, include, ...])

DataDerivedScaling.model_construct([_fields_set])

Creates a new instance of the Model class with validated data.

DataDerivedScaling.model_copy(*[, update, deep])

!!! abstract "Usage Documentation"

DataDerivedScaling.model_dump(*[, mode, ...])

!!! abstract "Usage Documentation"

DataDerivedScaling.model_dump_json(*[, ...])

!!! abstract "Usage Documentation"

DataDerivedScaling.model_json_schema([...])

Generates a JSON schema for a model class.

DataDerivedScaling.model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

DataDerivedScaling.model_post_init(context, /)

Override this method to perform additional initialization after __init__ and model_construct.

DataDerivedScaling.model_rebuild(*[, force, ...])

Try to rebuild the pydantic-core schema for the model.

DataDerivedScaling.model_validate(obj, *[, ...])

Validate a pydantic model instance.

DataDerivedScaling.model_validate_json(...)

!!! abstract "Usage Documentation"

DataDerivedScaling.model_validate_strings(obj, *)

Validate the given object with string data against the Pydantic model.

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

DataDerivedScaling.parse_obj(obj)

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

DataDerivedScaling.scaling_description()

Human-readable summary of the scaling strategy.

DataDerivedScaling.schema([by_alias, ...])

DataDerivedScaling.schema_json(*[, ...])

DataDerivedScaling.to_dict([_orig])

Serialize to a dict via Pydantic model_dump.

DataDerivedScaling.update_forward_refs(**localns)

DataDerivedScaling.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.

method

dims