Skip to main content
Version: Latest

auto_mmm

auto_mmm performs attribution from aggregated marketing signals using the automatic media-mix attribution engine. It supports multiple variables per channel and a separate D_measures mapping so the model can handle same-measure, different-measure, and mixed signal structures.

Input structure

Data should contain:

  • a timestamp column
  • one target column mapped to "target" in D_variables
  • one or more signal columns mapped to their final channel names

D_variables maps each column in Data to either the target or a channel name.

D_measures maps each non-target input column to its measure type, such as impressions, clicks, cost, or another supported measure label.

Parameters

PARAMETERTYPEDEFAULTDESCRIPTION
Datadata.frameAggregated dataset with timestamp, target, and input signal columns.
D_variablesdictionary / listMapping from each input column to "target" or to its final channel name.
D_measuresdictionary / listMapping from each non-target input column to its measure type.
max_pint12Maximum lag length considered when the model evaluates delayed effects.
nsimint1000Number of simulations used by the automatic MMM engine.
seedint1234567Random seed for reproducible results.
verboseint / bool1Controls runtime logging.
serverstr / list[str]app.channelattribution.ioServer endpoint used by the hosted computation service.
passwordstrNULL / NoneAuthentication token for the hosted service.
return_diagnosticsboolFALSE / FalseIf enabled, returns attribution together with diagnostic objects for advanced inspection.

Output

If return_diagnostics = FALSE, the function returns an attribution data frame.

If return_diagnostics = TRUE, the function returns a list/dict containing:

OUTPUTTYPEDESCRIPTION
attributiondata.frameChannel attribution by time period.
base_rawdata.frame / objectRaw baseline attribution output before final adjustments.
score_multiplierdata.frame / objectScore multiplier information used during attribution assembly.
applied_score_multiplierdata.frame / objectEffective multiplier applied to the returned attribution.
modestrExecution mode metadata.
diagnosticslist / dictAdditional diagnostics intended for advanced inspection.