meridian.model.context.ModelContext

Model context for Meridian.

This class contains all model parameters that do not change between the runs of Meridian.

adstock_decay_spec Returns AdstockDecaySpec object with correctly mapped channels.
baseline_geo_idx Returns the index of the baseline geo.
controls

controls_scaled

controls_transformer Returns a CenteringAndScalingTransformer for controls, if it exists.
holdout_id

input_data

is_national

knot_info

kpi

kpi_scaled

kpi_transformer

media_effects_dist

media_tensors

model_spec

n_controls

n_geos

n_media_channels

n_media_times

n_non_media_channels

n_organic_media_channels

n_organic_rf_channels

n_rf_channels

n_times

non_media_transformer Returns a CenteringAndScalingTransformer for non-media treatments.
non_media_treatments

non_media_treatments_normalized Normalized non-media treatments.

The non-media treatments values are scaled by population (for channels where non_media_population_scaling_id is True) and normalized by centering and scaling with means and standard deviations.

organic_media_tensors

organic_rf_tensors

population

prior_broadcast Returns broadcasted PriorDistribution object.
revenue_per_kpi

rf_tensors

total_outcome

total_spend

unique_sigma_for_each_geo

Methods

populate_cached_properties

View source

Eagerly activates all cached properties.

This is useful for creating a tf.function computation graph with this Meridian object as part of a captured closure. Within the computation graph, internal state mutations are problematic, and so this method freezes the object's states before the computation graph is created.