MediaMuEffect.incrementality_spec#

MediaMuEffect.incrementality_spec()[source]#

Opt this effect in to spend-counterfactual incrementality analysis.

Incrementality perturbs channel_data and reads the resulting change in the linear predictor. An effect that depends on channel_data – a funnel mediator, say – carries part of that change, and is only included in the increment if it returns a spec here.

The default returns None, which is correct for every effect whose contribution does not depend on channel_data: such an effect belongs to the baseline, is unaffected by the counterfactual, and is skipped without ever consulting this method. An effect that does depend on channel_data and returns None raises NotImplementedError rather than being silently dropped from the increment.

Opting in costs one line – return IncrementalitySpec() – because the spec’s fields are overrides for quantities that are otherwise measured from the graph.

Returns:
IncrementalitySpec or None

None to opt out.

See also

IncrementalitySpec

What has to be declared, and why.