meridian.analysis.visualizer.ReachAndFrequency

Generates reach and frequency plots for the Meridian model.

Plots the ROI by frequency for reach and frequency (RF) channels.

meridian Media mix model with the raw data from the model fitting.
selected_times Optional list containing a subset of times to include. By default, all time periods are included.
use_kpi If True, KPI is used instead of revenue.

optimal_frequency_data Dataset holding the calculated optimal reach and frequency metrics.

The dataset contains the following:

  • Coordinates: frequency, rf_channel, metric (mean, ci_hi, ci_lo)
  • Data variables: roi, optimal_frequency

Methods

plot_optimal_frequency

View source

Plots the optimal frequency curves for selected channels.

Args
selected_channels Optional list of RF channels to plot.

Returns
A faceted Altair plot showing a curve of the optimal frequency for the RF channels.

update_optimal_reach_and_frequency_selected_times

View source

Updates the selected times for optimal reach and frequency data.

Args
selected_times Optional list containing a subset of times to include. By default, all time periods are included.