schema.processors.reach_frequency_optimization_processor.ReachFrequencyOptimizationSpec

Spec dataclass for marketing reach and frequency optimization processor.

Inherits From: OptimizationSpec, DatedSpec

A frequency grid is generated using the range [rounded_min_frequency, rounded_max_frequency] and a step size of STEP_SIZE=0.1. rounded_min_frequency and rounded_max_frequency are rounded to the nearest multiple of STEP_SIZE.

This spec is used both as user input to inform the R&F optimization processor of its constraints and parameters, as well as an output structure that is serializable to a ReachFrequencyOptimizationSpec proto. The latter serves as a metadata embedded in a ReachFrequencyOptimizationResult. The output spec in the proto reflects the actual numbers used to generate the reach and frequency optimization result.

min_frequency The minimum frequency constraint for each channel. Must be greater than or equal to 1.0. Defaults to 1.0.
max_frequency The maximum frequency constraint for each channel. Must be greater than min_frequency. Defaults to None. If this value is set to None, the model's max frequency will be used.
rf_channels The R&F media channels in the model. When resolved with a model, the model's R&F channels will be present here. Ignored when used as input.
kpi_type A common.KpiType enum denoting whether the optimized KPI is of a 'revenue' or 'non-revenue' type.
objective A Meridian budget optimization objective is always ROI.
selected_times The start and end dates, as a tuple of date strings.
start_date Dataclass field
end_date Dataclass field
date_interval_tag Dataclass field
optimization_name Dataclass field
grid_name Dataclass field
group_id Dataclass field
confidence_level Dataclass field

Methods

resolver

View source

Returns a date resolver for this spec, with the given Meridian model.

to_proto

View source

validate

View source

Check optimization parameters are valid.

__eq__

Return self==value.

confidence_level 0.9
date_interval_tag ''
end_date None
group_id None
kpi_type <KpiType.REVENUE: 2>
max_frequency None
min_frequency 1.0
start_date None