Skip to contents

Create a list with configuration settings used by all functions in this package.

Usage

appraise_configure(
  sample = TRUE,
  sample_size = 1e+05,
  holdout_date = NA,
  unified_horizon = 5,
  pred_periods = c(0.5, 1.5, 2.5, 3.5, 4.5),
  n_forecast = NA_integer_,
  use_priors = 0,
  cm = NA_real_,
  cpa = NA_real_,
  currency = "$",
  aws_bucket = NA_character_,
  google_drive_id = NA_character_
)

configure_appraise(
  sample = TRUE,
  sample_size = 1e+05,
  holdout_date = NA,
  unified_horizon = 5,
  pred_periods = c(0.5, 1.5, 2.5, 3.5, 4.5),
  n_forecast = NA_integer_,
  use_priors = 0,
  cm = NA_real_,
  cpa = NA_real_,
  currency = "$",
  aws_bucket = NA_character_,
  google_drive_id = NA_character_
)

Arguments

sample

Logical. Should the rest of the Appraise functions work with a sample. Can substantially lower computation times.

sample_size

Numeric. Number of unique customers to model.

holdout_date

Date. Up till what date will the data be used to build the model? The remaining time will be applied to BTYDplus::elog2cbs() so we can measure model performance.

unified_horizon

Integer. Number of years. The unified horizon puts all customers on the same year scale. If a customer was acquired in the fourth year, and the unified_horizon is set to 5, it will add 4 estimated years. If a customer was acquired in the first year, it will use all of his actual sales.

pred_periods

Numeric vector. Periods to predict in years. if your prediction periods are in months, divide by 12. If they are in weeks, divide by 52.

n_forecast

Integer. Number of weeks to forecast.

use_priors

Either 0 (do not use priors) or 1 (use priors).

cm

Numeric vector. Contribution Margin (CM) in proportions (e.g., 0.3 = 30%).

cpa

Numeric vector. Cost per Acquisition (CPA) vector in currency.

currency

Character vector. Currency to use in all outputs.

aws_bucket

Character. Bucket that holds the data, model and plots folders. Typically something like; monorepo-data/project/.

google_drive_id

Character. Google Drive ID for the folder you want to store your results in.

Value

A list

Examples


# Example from the `Medicine` project:

config <- appraise_configure(sample = TRUE,
                             cpa = c(25, 50, 75, 100, 125, 150, 200),
                             cm =  c(.2, .3, .432, .5),
                             currency = '$',
                             n_forecast =  5*52)