robyn_outputs: Evaluate Models and Output Results into Local Files

View source: R/outputs.R

robyn_outputsR Documentation

Evaluate Models and Output Results into Local Files

Description

Pack robyn_plots(), robyn_csv(), and robyn_clusters() outcomes on robyn_run() results. When UI=TRUE, enriched OutputModels results with additional plots and objects.

Create a plot to visualize the convergence for each of the datasets when running robyn_run(), especially useful for when using ts_validation. As a reference, the closer the test and validation convergence points are, the better, given the time-series wasn't overfitted.

Usage

robyn_outputs(
  InputCollect,
  OutputModels,
  pareto_fronts = "auto",
  calibration_constraint = 0.1,
  plot_folder = NULL,
  plot_folder_sub = NULL,
  plot_pareto = TRUE,
  csv_out = "pareto",
  clusters = TRUE,
  select_model = "clusters",
  ui = FALSE,
  export = TRUE,
  all_sol_json = FALSE,
  quiet = FALSE,
  refresh = FALSE,
  ...
)

## S3 method for class 'robyn_outputs'
print(x, ...)

robyn_csv(
  InputCollect,
  OutputCollect,
  csv_out = NULL,
  export = TRUE,
  calibrated = FALSE
)

robyn_plots(
  InputCollect,
  OutputCollect,
  export = TRUE,
  plot_folder = OutputCollect$plot_folder,
  ...
)

robyn_onepagers(
  InputCollect,
  OutputCollect,
  select_model = NULL,
  quiet = FALSE,
  export = TRUE,
  plot_folder = OutputCollect$plot_folder,
  baseline_level = 0,
  ...
)

ts_validation(OutputModels, quiet = FALSE, ...)

decomp_plot(
  InputCollect,
  OutputCollect,
  solID = NULL,
  exclude = NULL,
  baseline_level = 0
)

Arguments

InputCollect, OutputModels

robyn_inputs() and robyn_run() outcomes.

pareto_fronts

Integer. Number of Pareto fronts for the output. pareto_fronts = 1 returns the best models trading off NRMSE & DECOMP.RSSD. Increase pareto_fronts to get more model choices. pareto_fronts = "auto" selects the min fronts that include at least 100 candidates. To customize this threshold, set value with min_candidates.

calibration_constraint

Numeric. Default to 0.1 and allows 0.01-0.1. When calibrating, 0.1 means top 10 selection. Lower calibration_constraint increases calibration accuracy.

plot_folder

Character. Path for saving plots and files. Default to robyn_object and saves plot in the same directory as robyn_object.

plot_folder_sub

Character. Sub path for saving plots. Will overwrite the default path with timestamp or, for refresh and allocator, simply overwrite files.

plot_pareto

Boolean. Set to FALSE to deactivate plotting and saving model one-pagers. Used when testing models.

csv_out

Character. Accepts "pareto" or "all". Default to "pareto". Set to "all" will output all iterations as csv. Set NULL to skip exports into CSVs.

clusters

Boolean. Apply robyn_clusters() to output models?

select_model

Character vector. Which models (by solID) do you wish to plot the one-pagers and export? Default will take top robyn_clusters() results.

ui

Boolean. Save additional outputs for UI usage. List outcome.

export

Boolean. Export outcomes into local files?

all_sol_json

Logical. Add all pareto solutions to json export?

quiet

Boolean. Keep messages off?

refresh

Boolean. Refresh mode

...

Additional parameters passed to robyn_clusters()

x

robyn_outputs() output.

OutputCollect

robyn_run(..., export = FALSE) output.

calibrated

Logical

baseline_level

Integer, from 0 to 5. Aggregate baseline variables, depending on the level of aggregation you need. Default is 0 for no aggregation. 1 for Intercept only. 2 adding trend. 3 adding all prophet decomposition variables. 4. Adding contextual variables. 5 Adding organic variables. Results will be reflected on the waterfall chart.

solID

Character vector. Model IDs to plot.

exclude

Character vector. Manually exclude variables from plot.

Value

(Invisible) list. Class: robyn_outputs. Contains processed results based on robyn_run() results.

Invisible NULL.

Invisible list with ggplot plots.

Invisible list with patchwork plot(s).

Invisible list with ggplot plots.


Robyn documentation built on June 27, 2024, 9:06 a.m.