当预言机模型在循环中运行并且循环的终止不是以特定方式终止时,R 崩溃,即它随机崩溃 R。
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)
}