facebookexperimental / Robyn

Robyn is an experimental, AI/ML-powered and open sourced Marketing Mix Modeling (MMM) package from Meta Marketing Science. Our mission is to democratise modeling knowledge, inspire the industry through innovation, reduce human bias in the modeling process & build a strong open source marketing science community.
https://facebookexperimental.github.io/Robyn/
MIT License
1.16k stars 346 forks source link

Error in check_context(dt_input, context_vars, context_signs) : Allowed values for 'context_signs' are: positive, negative, default #1161

Open sab26699 opened 5 days ago

sab26699 commented 5 days ago

Project Robyn

Describe issue

Working with a data set that has many contextual variables and keep getting the following error. I know I need to adjust something about the data set, but I'm not sure what. Any guidance would be helpful.

Error in check_context(dt_input, context_vars, context_signs) : 
  Allowed values for 'context_signs' are: positive, negative, default

Provide reproducible example

Blinded sample data set: MMMWeeklyV2.xlsx

InputCollect <- robyn_inputs(
  dt_input = MMMWeeklyV2,
  dt_holidays = dt_prophet_holidays,
  date_var = "Date", # date format must be "2020-01-01"
  dep_var = "Revenue", # there should be only one dependent variable
  dep_var_type = "revenue", # "revenue" (ROI) or "conversion" (CPA)
  prophet_vars = c("trend", "season", "holiday"), # "trend","season", "weekday" & "holiday"
  prophet_country = "US", # input country code. Check: dt_prophet_holidays
  context_vars = c("econactiv", "privatehousingunits", "thirtyyrmortgage", "vehiclesales", "primeloan"), # e.g. competitors, discount, unemployment etc
  paid_media_spends = c("Radio_S", "DSPDis_S", "DSPVid_S", "DSPAud_S", "FBBrand_S", "FBNonBrand_S", "GoogleBrand_S", "GoogleNonBrand_S", "YouTube_S"), # mandatory input
  paid_media_vars = c("Radio_S", "DSPDis_I", "DSPVid_I", "DSPAud_I", "FBBrand_I", "FBNonBrand_I", "GoogleBrand_I", "GoogleNonBrand_I", "YouTube_I" ), # mandatory.
  # paid_media_vars must have same order as paid_media_spends. Use media exposure metrics like
  # impressions, GRP etc. If not applicable, use spend instead.
  organic_vars = "Promo_NIL", "Promo_Home", "Promo_Product", "Event", # marketing activity without media spend
  factor_vars = c("Promo_NIL", "Promo_Home", "Promo_Product", "Event"), # force variables in context_vars or organic_vars to be categorical
  window_start = "2018-12-30",
  window_end = "2024-08-25",
  adstock = "geometric" # geometric, weibull_cdf or weibull_pdf.
)
print(InputCollect)

Environment & Robyn version

Make sure you're using the latest Robyn version before you post an issue.