Meridian EDA Engine.
meridian
.
model
.
eda
.
eda_engine
.
EDAEngine
(
meridian
:
(
model
.
Meridian
|
None
)
=
None
,
spec
:
eda_spec
.
EDASpec
=
eda_spec
.
EDASpec
()
, *
,
model_context
:
(
context
.
ModelContext
|
None
)
=
None
)
Attributes
This includes both paid and organic frequency, concatenated along the RF_CHANNEL dimension.
This includes both paid and organic reach, concatenated along the RF_CHANNEL dimension.
This includes media spend and rf spend.
If the input spend is aggregated, it is allocated across geo and time proportionally to media units.
This includes both paid and organic frequency, concatenated along the RF_CHANNEL dimension.
This includes both paid and organic reach, concatenated along the RF_CHANNEL dimension.
This includes media spend and rf spend.
This includes media, RF impressions, organic media, organic RF impressions, non-media treatments, and control variables, all at the national level.
If the input spend is aggregated, it is allocated across geo and time proportionally to RF impressions (reach * frequency).
This includes media, RF impressions, organic media, organic RF impressions, non-media treatments, and control variables, all at the geo level.
Methods
check_cost_per_media_unit
check_cost_per_media_unit
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
CostPerMediaUnitArtifact
]
Checks if the cost per media unit is valid.
This function checks the following conditions: 1. cost == 0 and media unit > 0. 2. cost > 0 and media unit == 0. 3. cost_per_media_unit has outliers.
check_geo_cost_per_media_unit
check_geo_cost_per_media_unit
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
CostPerMediaUnitArtifact
]
Checks if the cost per media unit is valid for geo data.
GeoLevelCheckOnNationalModelError
check_geo_pairwise_corr
check_geo_pairwise_corr
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
PairwiseCorrArtifact
]
Checks pairwise correlation among treatments and controls for geo data.
GeoLevelCheckOnNationalModelError
check_geo_std
check_geo_std
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
StandardDeviationArtifact
]
Checks std for geo-level KPI, treatments, R&F, and controls.
check_geo_vif
check_geo_vif
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
VIFArtifact
]
Checks geo variance inflation factor among treatments and controls.
The VIF calculation only focuses on multicollinearity among non-constant variables. Any variable with constant values will result in a NaN VIF value.
check_national_cost_per_media_unit
check_national_cost_per_media_unit
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
CostPerMediaUnitArtifact
]
Checks if the cost per media unit is valid for national data.
check_national_pairwise_corr
check_national_pairwise_corr
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
PairwiseCorrArtifact
]
Checks pairwise correlation among treatments and controls for national data.
check_national_std
check_national_std
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
StandardDeviationArtifact
]
Checks std for national-level KPI, treatments, R&F, and controls.
check_national_vif
check_national_vif
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
VIFArtifact
]
Checks national variance inflation factor among treatments and controls.
The VIF calculation only focuses on multicollinearity among non-constant variables. Any variable with constant values will result in a NaN VIF value.
check_overall_kpi_invariability
check_overall_kpi_invariability
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
KpiInvariabilityArtifact
]
Checks if the KPI is constant across all geos and times.
check_pairwise_corr
check_pairwise_corr
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
PairwiseCorrArtifact
]
Checks pairwise correlation among treatments and controls.
check_population_corr_raw_media
check_population_corr_raw_media
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
PopulationCorrelationArtifact
]
Checks Spearman correlation between population and raw media executions.
Calculates correlation between population and time-averaged raw media executions (paid/organic impressions/reach). These are expected to have reasonably high correlation with population.
GeoLevelCheckOnNationalModelError
check_population_corr_scaled_treatment_control
check_population_corr_scaled_treatment_control
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
PopulationCorrelationArtifact
]
Checks Spearman correlation between population and treatments/controls.
Calculates correlation between population and time-averaged treatments and controls. High correlation for controls or non-media channels may indicate a need for population-scaling. High correlation for other media channels may indicate double-scaling.
GeoLevelCheckOnNationalModelError
check_std
check_std
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
StandardDeviationArtifact
]
Checks standard deviation for treatments and controls.
check_variable_geo_time_collinearity
check_variable_geo_time_collinearity
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
VariableGeoTimeCollinearityArtifact
]
Compute adjusted R-squared for treatments and controls vs geo and time.
These checks are applied to geo-level dataset only.
check_vif
check_vif
()
->
eda_outcome
.
EDAOutcome
[
eda_outcome
.
VIFArtifact
]
Computes variance inflation factor among treatments and controls.
The VIF calculation only focuses on multicollinearity among non-constant variables. Any variable with constant values will result in a NaN VIF value.
run_all_critical_checks
run_all_critical_checks
()
->
eda_outcome
.
CriticalCheckEDAOutcomes
Runs all critical EDA checks.
Critical checks are those that can result in EDASeverity.ERROR findings.



