Join the newly launched
Discord community for real-time discussions, peer support, and direct interaction with the Meridian team!
meridian.model.context.ModelContext
Stay organized with collections
Save and categorize content based on your preferences.
Model context for Meridian.
meridian.model.context.ModelContext(
input_data: meridian.data.input_data.InputData,
model_spec: meridian.model.spec.ModelSpec
)
This class contains all model parameters that do not change between the runs
of Meridian.
Attributes |
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
populate_cached_properties()
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-09 UTC.
[null,null,["Last updated 2025-12-09 UTC."],[],[]]