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.07k stars 322 forks source link

Robyn allocator doesn't accept vector format of the date_range #900

Closed openhubber closed 5 months ago

openhubber commented 5 months ago

Project Robyn

Describe issue

Robyn allocator doesn't accept vector format of the date_range.

AllocatorCollect <- robyn_allocator(
  InputCollect = InputCollect,
  OutputCollect = OutputCollect,
  select_model = select_model,
  date_range = date_range
  total_budget = total_budget, # Total budget for date_range period simulation
  channel_constr_low = channel_constr_low,
  channel_constr_up = channel_constr_up,
  channel_constr_multiplier = channel_constr_multiplier, # Customise bound extension for wider insights
  scenario = scenario,
  export = export
)

The above code works fine if date_range <- "last_91"

However, it produces an error if
date_range <- c("2023-01-01", "2023-04-01"),

Running budget allocator for model ID 2_285_1 ... Date Window: 2023-01-01:2023-04-01 (91 days) Error in if (date_range == "all") { : the condition has length > 1 Calls: main -> optimize -> robyn_allocator -> which_usecase In addition: There were 20 warnings (use warnings() to see them) Execution halted

Provide reproducible example

Environment & Robyn version

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

openhubber commented 5 months ago

Closing this issue as an update to the Robyn version solved the problelm