robyn_allocator | R Documentation |
robyn_allocator()
function returns a new split of media
variable spends that maximizes the total media response.
robyn_allocator(
robyn_object = NULL,
select_build = 0,
InputCollect = NULL,
OutputCollect = NULL,
select_model = NULL,
json_file = NULL,
scenario = "max_response",
total_budget = NULL,
target_value = NULL,
date_range = "all",
channel_constr_low = NULL,
channel_constr_up = NULL,
channel_constr_multiplier = 3,
optim_algo = "SLSQP_AUGLAG",
maxeval = 1e+05,
constr_mode = "eq",
plots = TRUE,
plot_folder = NULL,
plot_folder_sub = NULL,
export = TRUE,
quiet = FALSE,
ui = FALSE,
...
)
## S3 method for class 'robyn_allocator'
print(x, ...)
## S3 method for class 'robyn_allocator'
plot(x, ...)
robyn_object |
Character or List. Path of the |
select_build |
Integer. Default to the latest model build. |
InputCollect |
List. Contains all input parameters for the model.
Required when |
OutputCollect |
List. Containing all model result.
Required when |
select_model |
Character. A model |
json_file |
Character. JSON file to import previously exported inputs or
recreate a model. To generate this file, use |
scenario |
Character. Accepted options are: |
total_budget |
Numeric. Total marketing budget for all paid channels for the
period in |
target_value |
Numeric. When using the scenario |
date_range |
Character. Date(s) to apply adstocked transformations and pick mean spends
per channel. Set one of: "all", "last", or "last_n" (where
n is the last N dates available), date (i.e. "2022-03-27"), or date range
(i.e. |
channel_constr_low , channel_constr_up |
Numeric vectors. The lower and upper bounds
for each paid media variable when maximizing total media response. For example,
|
channel_constr_multiplier |
Numeric. Default to 3. For example, if
|
optim_algo |
Character. Default to |
maxeval |
Integer. The maximum iteration of the global optimization algorithm. Defaults to 100000. |
constr_mode |
Character. Options are |
plots |
Boolean. Generate plots? |
plot_folder |
Character. Path for saving plots and files. Default
to |
plot_folder_sub |
Character. Sub path for saving plots. Will overwrite the default path with timestamp or, for refresh and allocator, simply overwrite files. |
export |
Boolean. Export outcomes into local files? |
quiet |
Boolean. Keep messages off? |
ui |
Boolean. Save additional outputs for UI usage. List outcome. |
... |
Additional parameters passed to |
x |
|
A list object containing allocator result.
List. Contains optimized allocation results and plots.
## Not run:
# Having InputCollect and OutputCollect results
AllocatorCollect <- robyn_allocator(
InputCollect = InputCollect,
OutputCollect = OutputCollect,
select_model = "1_2_3",
scenario = "max_response",
channel_constr_low = 0.7,
channel_constr_up = c(1.2, 1.5, 1.5, 1.5, 1.5),
channel_constr_multiplier = 4,
date_range = "last_26",
export = FALSE
)
# Print a summary
print(AllocatorCollect)
# Plot the allocator one-pager
plot(AllocatorCollect)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.