Learn R Programming

Robyn (version 3.12.1)

hyper_names: Get correct hyperparameter names

Description

Output all hyperparameter names and help specifying the list of hyperparameters that is inserted into robyn_inputs(hyperparameters = ...)

Usage

hyper_names(adstock, all_media, all_vars = NULL)

Value

Character vector. Names of hyper-parameters that should be defined.

Arguments

adstock

Character. Default to InputCollect$adstock. Accepts "geometric", "weibull_cdf" or "weibull_pdf"

all_media

Character vector. Default to InputCollect$all_media. Includes InputCollect$paid_media_spends and InputCollect$organic_vars.

all_vars

Used to check the penalties inputs, especially for refreshing models.

Guide to setup hyperparameters

See section "Hyperparameter interpretation & recommendation" in demo https://github.com/facebookexperimental/Robyn/blob/main/demo/demo.R

Helper plots

plot_adstock(TRUE)

Get adstock transformation example plot, helping you understand geometric/theta and weibull/shape/scale transformation

plot_saturation(TRUE)

Get saturation curve transformation example plot, helping you understand hill/alpha/gamma transformation

Examples

Run this code
# \donttest{
media <- c("facebook_I", "print_S", "tv_S")
hyper_names(adstock = "geometric", all_media = media)

hyperparameters <- list(
  facebook_I_alphas = c(0.5, 3), # example bounds for alpha
  facebook_I_gammas = c(0.3, 1), # example bounds for gamma
  facebook_I_thetas = c(0, 0.3), # example bounds for theta
  print_S_alphas = c(0.5, 3),
  print_S_gammas = c(0.3, 1),
  print_S_thetas = c(0.1, 0.4),
  tv_S_alphas = c(0.5, 3),
  tv_S_gammas = c(0.3, 1),
  tv_S_thetas = c(0.3, 0.8)
)

# Define hyper_names for weibull adstock
hyper_names(adstock = "weibull_pdf", all_media = media)

hyperparameters <- list(
  facebook_I_alphas = c(0.5, 3), # example bounds for alpha
  facebook_I_gammas = c(0.3, 1), # example bounds for gamma
  facebook_I_shapes = c(0.0001, 2), # example bounds for shape
  facebook_I_scales = c(0, 0.1), # example bounds for scale
  print_S_alphas = c(0.5, 3),
  print_S_gammas = c(0.3, 1),
  print_S_shapes = c(0.0001, 2),
  print_S_scales = c(0, 0.1),
  tv_S_alphas = c(0.5, 3),
  tv_S_gammas = c(0.3, 1),
  tv_S_shapes = c(0.0001, 2),
  tv_S_scales = c(0, 0.1)
)
# }

Run the code above in your browser using DataLab