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 through a tabular D_variables configuration that declares each input variable, its final channel, and its measure type.

Input structure

Data should contain:

  • a timestamp column
  • one target column, passed separately through the target parameter
  • one or more signal columns used as attribution inputs

D_variables should be a table/data frame with one row per non-target signal variable and these columns:

COLUMNDESCRIPTION
variableName of the signal column in Data.
channelFinal attribution channel associated with the signal. Multiple variables can map to the same channel.
measureMeasure type for the signal, such as impressions, clicks, cost, direct_searches, platform_signal, or another supported measure label.

The old D_measures parameter is no longer used. Measure information must be provided inside D_variables.

Example D_variables structure:

variable              channel       measure
direct_searches direct direct_searches
facebook_impressions facebook_ads impressions
facebook_cost facebook_ads cost
google_impressions google_ads impressions
google_clicks google_ads clicks
google_cost google_ads cost

Parameters

PARAMETERTYPEDEFAULTDESCRIPTION
Datadata.frameAggregated dataset with timestamp, target, and input signal columns.
D_variablesdata.frame / tableTable with variable, channel, and measure columns.
targetstr"conversions"Name of the target column in Data.
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_multiplierdict / objectScore multiplier information used during attribution assembly.
applied_score_multiplierdict / objectEffective multiplier applied to the returned attribution.
individual_scoresdict / objectChannel-level scores selected from the lag evaluation.
modestrExecution mode metadata.
diagnosticslist / dictAdditional diagnostics intended for advanced inspection.