atomica.optimization.MaximizeCascadeConversionRate¶
- class atomica.optimization.MaximizeCascadeConversionRate(cascade_name, t, pop_names='all', weight=1.0)[source]¶
Bases:
MeasurableMaximize overall conversion rate
Maximize conversion summed over all cascade stages
- Parameters:
cascade_name – The name of one of the cascades in the Framework
t (
float) – A single time value e.g. 2020pop_names – A single pop name (including ‘all’), a list of populations, or a dict/list of dicts, each with a single aggregation e.g.
{'foo':['0-4','5-14']}weight – Weighting factor for this Measurable in the overall objective function
Methods
evalReturn cached baseline values
Return objective value
- get_baseline(model)¶
Return cached baseline values
Similar to
get_hard_constraint, sometimes a relativeMeasurablemight be desired e.g. ‘Reduce deaths by at least 50%’. In that case, we need to perform a procedure similar to getting a hard constraint, where theMeasurablereceives an initialModelobject and extracts baseline data for subsequent use inget_objective_val.Thus, the output of this function is paired to its usage in
get_objective_val.- Parameters:
model
- Returns:
The value to pass back to the
Measurableduring optimization
- get_objective_val(model, baseline)[source]¶
Return objective value
This method should return the _unweighted_ objective value. Note that further transformation may occur
- Parameters:
model – A
Modelobject after integrationbaseline – The baseline variable returned by this
Measurableat the start of optimization
- Returns:
A scalar objective value