diff --git a/R/DESCRIPTION b/R/DESCRIPTION index a68e60a5c..23aabbf70 100644 --- a/R/DESCRIPTION +++ b/R/DESCRIPTION @@ -1,14 +1,14 @@ Package: Robyn Type: Package Title: Semi-Automated Marketing Mix Modeling (MMM) from Meta Marketing Science -Version: 3.10.7.9001 +Version: 3.11.0 Authors@R: c( - person("Gufeng", "Zhou", , "gufeng@meta.com", c("cre","aut")), - person("Bernardo", "Lares", , "laresbernardo@gmail.com", c("aut")), + person("Gufeng", "Zhou", , "gufeng@meta.com", c("aut")), + person("Bernardo", "Lares", , "laresbernardo@gmail.com", c("cre","aut")), person("Leonel", "Sentana", , "leonelsentana@meta.com", c("aut")), person("Igor", "Skokan", , "igorskokan@meta.com", c("aut")), person("Meta Platforms, Inc.", role = c("cph", "fnd"))) -Maintainer: Gufeng Zhou +Maintainer: Bernardo Lares Description: Semi-Automated Marketing Mix Modeling (MMM) aiming to reduce human bias by means of ridge regression and evolutionary algorithms, enables actionable decision making providing a budget allocation and diminishing returns curves and allows ground-truth calibration to account for causation. Depends: R (>= 4.0.0) @@ -30,8 +30,6 @@ Imports: reticulate, stringr, tidyr -Suggests: - shiny Config/reticulate: list( packages = list( diff --git a/R/R/inputs.R b/R/R/inputs.R index 9cf27a8f6..141fdc545 100644 --- a/R/R/inputs.R +++ b/R/R/inputs.R @@ -477,24 +477,24 @@ Adstock: {x$adstock} #' needs to be specified in \code{paid_media_spends} specifically. Run \code{hyper_names()} #' to get correct hyperparameter names. All names in hyperparameters must #' equal names from \code{hyper_names()}, case sensitive. -#' \item{Get guidance for setting hyperparameter bounds: +#' \item Get guidance for setting hyperparameter bounds: #' For geometric adstock, use theta, alpha & gamma. For both weibull adstock options, -#' use shape, scale, alpha, gamma.} +#' use shape, scale, alpha, gamma. #' \itemize{ -#' \item{Theta: }{In geometric adstock, theta is decay rate. guideline for usual media genre: -#' TV c(0.3, 0.8), OOH/Print/Radio c(0.1, 0.4), digital c(0, 0.3)} -#' \item{Shape: }{In weibull adstock, shape controls the decay shape. Recommended c(0.0001, 2). +#' \item Theta: In geometric adstock, theta is decay rate. guideline for usual media genre: +#' TV c(0.3, 0.8), OOH/Print/Radio c(0.1, 0.4), digital c(0, 0.3) +#' \item Shape: In weibull adstock, shape controls the decay shape. Recommended c(0.0001, 2). #' The larger, the more S-shape. The smaller, the more L-shape. Channel-type specific -#' values still to be investigated} -#' \item{Scale: }{In weibull adstock, scale controls the decay inflexion point. Very conservative +#' values still to be investigated +#' \item Scale: In weibull adstock, scale controls the decay inflexion point. Very conservative #' recommended bounce c(0, 0.1), because scale can increase adstocking half-life greatly. -#' Channel-type specific values still to be investigated} -#' \item{Gamma: }{In s-curve transformation with hill function, gamma controls the inflexion point. +#' Channel-type specific values still to be investigated +#' \item Gamma: In s-curve transformation with hill function, gamma controls the inflexion point. #' Recommended bounce c(0.3, 1). The larger the gamma, the later the inflection point -#' in the response curve} +#' in the response curve #' } -#' \item{Set each hyperparameter bounds. They either contains two values e.g. c(0, 0.5), -#' or only one value (in which case you've "fixed" that hyperparameter)} +#' \item Set each hyperparameter bounds. They either contains two values e.g. c(0, 0.5), +#' or only one value (in which case you've "fixed" that hyperparameter) #' } #' #' @section Helper plots: diff --git a/R/R/plots.R b/R/R/plots.R index 84fe7df70..80be08319 100644 --- a/R/R/plots.R +++ b/R/R/plots.R @@ -427,29 +427,27 @@ robyn_onepagers <- function( sign = as.factor(ifelse(.data$xDecompPerc >= 0, "Positive", "Negative")) ) - p2 <- suppressWarnings( - ggplot(plotWaterfallLoop, aes(x = .data$id, fill = .data$sign)) + - geom_rect(aes( - x = .data$rn, xmin = .data$id - 0.45, xmax = .data$id + 0.45, - ymin = .data$end, ymax = .data$start - ), stat = "identity") + - scale_x_discrete("", breaks = levels(plotWaterfallLoop$rn), labels = plotWaterfallLoop$rn) + - scale_y_percent() + - scale_fill_manual(values = c("Positive" = "#59B3D2", "Negative" = "#E5586E")) + - theme_lares(background = "white", legend = "top") + - geom_text(mapping = aes( - label = paste0( - formatNum(.data$xDecompAgg, abbr = TRUE), - "\n", round(.data$xDecompPerc * 100, 1), "%" - ), - y = rowSums(cbind(.data$end, .data$xDecompPerc / 2)) - ), fontface = "bold", lineheight = .7) + - coord_flip() + - labs( - title = "Response Decomposition Waterfall by Predictor", - x = NULL, y = NULL, fill = "Sign" - ) - ) + p2 <- ggplot(plotWaterfallLoop, aes(x = .data$id, fill = .data$sign)) + + geom_rect(aes( + xmin = .data$id - 0.45, xmax = .data$id + 0.45, + ymin = .data$end, ymax = .data$start + ), stat = "identity") + + scale_x_discrete("", breaks = levels(plotWaterfallLoop$rn), labels = plotWaterfallLoop$rn) + + scale_y_percent() + + scale_fill_manual(values = c("Positive" = "#59B3D2", "Negative" = "#E5586E")) + + theme_lares(background = "white", legend = "top") + + geom_text(mapping = aes( + label = paste0( + formatNum(.data$xDecompAgg, abbr = TRUE), + "\n", round(.data$xDecompPerc * 100, 1), "%" + ), + y = rowSums(cbind(.data$end, .data$xDecompPerc / 2)) + ), fontface = "bold", lineheight = .7) + + coord_flip() + + labs( + title = "Response Decomposition Waterfall by Predictor", + x = NULL, y = NULL, fill = "Sign" + ) ## 3. Adstock rate if (InputCollect$adstock == "geometric") { diff --git a/R/README.md b/R/README.md index a9fba9da6..9ee453afb 100644 --- a/R/README.md +++ b/R/README.md @@ -33,10 +33,3 @@ Meta's Robyn is MIT licensed, as found in the LICENSE file. - Terms of Use - https://opensource.facebook.com/legal/terms - Privacy Policy - https://opensource.facebook.com/legal/privacy - -## Contact - -* gufeng@meta.com, Gufeng Zhou, Marketing Science Partner -* leonelsentana@meta.com, Leonel Sentana, Marketing Science Partner -* igorskokan@meta.com, Igor Skokan, Marketing Science Partner -* bernardolares@meta.com, Bernardo Lares, Marketing Science Partner diff --git a/R/man/hyper_names.Rd b/R/man/hyper_names.Rd index e128bca90..3cb0442d9 100644 --- a/R/man/hyper_names.Rd +++ b/R/man/hyper_names.Rd @@ -32,24 +32,24 @@ hyperparameters that is inserted into \code{robyn_inputs(hyperparameters = ...)} needs to be specified in \code{paid_media_spends} specifically. Run \code{hyper_names()} to get correct hyperparameter names. All names in hyperparameters must equal names from \code{hyper_names()}, case sensitive. - \item{Get guidance for setting hyperparameter bounds: + \item Get guidance for setting hyperparameter bounds: For geometric adstock, use theta, alpha & gamma. For both weibull adstock options, - use shape, scale, alpha, gamma.} + use shape, scale, alpha, gamma. \itemize{ - \item{Theta: }{In geometric adstock, theta is decay rate. guideline for usual media genre: - TV c(0.3, 0.8), OOH/Print/Radio c(0.1, 0.4), digital c(0, 0.3)} - \item{Shape: }{In weibull adstock, shape controls the decay shape. Recommended c(0.0001, 2). + \item Theta: In geometric adstock, theta is decay rate. guideline for usual media genre: + TV c(0.3, 0.8), OOH/Print/Radio c(0.1, 0.4), digital c(0, 0.3) + \item Shape: In weibull adstock, shape controls the decay shape. Recommended c(0.0001, 2). The larger, the more S-shape. The smaller, the more L-shape. Channel-type specific - values still to be investigated} - \item{Scale: }{In weibull adstock, scale controls the decay inflexion point. Very conservative + values still to be investigated + \item Scale: In weibull adstock, scale controls the decay inflexion point. Very conservative recommended bounce c(0, 0.1), because scale can increase adstocking half-life greatly. - Channel-type specific values still to be investigated} - \item{Gamma: }{In s-curve transformation with hill function, gamma controls the inflexion point. + Channel-type specific values still to be investigated + \item Gamma: In s-curve transformation with hill function, gamma controls the inflexion point. Recommended bounce c(0.3, 1). The larger the gamma, the later the inflection point - in the response curve} + in the response curve } - \item{Set each hyperparameter bounds. They either contains two values e.g. c(0, 0.5), - or only one value (in which case you've "fixed" that hyperparameter)} + \item Set each hyperparameter bounds. They either contains two values e.g. c(0, 0.5), + or only one value (in which case you've "fixed" that hyperparameter) } } diff --git a/demo/demo.R b/demo/demo.R index 1fc3c4011..e59f3b6a3 100644 --- a/demo/demo.R +++ b/demo/demo.R @@ -4,7 +4,7 @@ # LICENSE file in the root directory of this source tree. ############################################################################################# -#################### Meta MMM Open Source: Robyn 3.10.7 ####################### +#################### Meta MMM Open Source: Robyn 3.11.0 ####################### #################### Quick demo guide ####################### ############################################################################################# @@ -412,7 +412,7 @@ AllocatorCollect3 <- robyn_allocator( InputCollect = InputCollect, OutputCollect = OutputCollect, select_model = select_model, - # date_range = NULL, # Default last month as initial period + # date_range = NULL, # Default: "all" available dates scenario = "target_efficiency", # target_value = 2, # Customize target ROAS or CPA value export = create_files