0

R crashes when prophet model run in a loop and the termination of the loop is not in a particular fashion i.e. it crashes R randomly.

for(j in seq_along(unique_code_train)) {
  train1 <- filter(train, CODE == unique_code_train[j])
  train1 <-arrange(train1, BILLDATE)
  train1 <-data.table(train1)
  names(train1) <- c("ds", "y") # billdate = ds , sum(saleamt) = y
  m <- prophet(train1, changepoint.range = 1.0, seasonality.mode =
  'multiplicative', holidays = holidays)
  future <- make_future_dataframe(m, periods = 26)
  forecast <- predict(m, future)
  forecast$yhat <- as.integer(forecast$yhat)
}
merv
  • 67,214
  • 13
  • 180
  • 245

1 Answers1

0

I've been having the same issue. Can you provide details about your system? Here's my post for reference. R Prophet crashing Rstudio in loop

EDIT: This was traced to a problem with rlang. Installing version 0.2.0 or 0.2.2 fixed the issue for most people, but I think people had only seen this issue on Windows. You might have something different going on, but it's worth a try. devtools::install_version("rlang", version="0.2.2")

spillway18
  • 221
  • 2
  • 7
  • my system configurations are i7, 8 GB RAM, R version- 3.5.1, i studied about prophet for a long time and i believe prophet package is under development and this issue is not resolved, i have tried a lot of things using prophet and still getting this issue – lalit panwar Sep 20 '18 at 11:07