business-science / modeltime

Modeltime unlocks time series forecast models and machine learning in one framework
https://business-science.github.io/modeltime/
Other
515 stars 79 forks source link

Timezone issue with prophet_reg() #237

Closed alejandrohagan closed 10 months ago

alejandrohagan commented 10 months ago

hi! First -- thank you for the package -- honestly such a game changer. I am having the below timezone error when using the package. It seems related to the lubridate but no matter how many times I've removed and install it the error won't go away

Error in C_force_tz(to_posixct(time), tz, roll_dst) : CCTZ: Unrecognized output timezone: "GMT"

I am using R 4.2.3 and Rtools 4.2.

library(tidyverse)
library(timetk)
library(modeltime)
library(tidymodels)

df <- timetk::bike_sharing_daily
split <- timetk::time_series_split(df,assess = 200,cumulative = TRUE)

(train <- training(split))
(test <- testing(split))

rec <- recipe(cnt~dteday,data=train)

mod <- prophet_reg() %>%
  set_engine("prophet")

wf <- workflow() %>%
  add_recipe(rec) %>%
  add_model(mod)

#error below
wf %>% fit(data=train)
alejandrohagan commented 10 months ago

It isn't an issue with modeltime or prophet but instead lubridate and timechange packages

Uninstalling lubridate and timechange and resinstalling fixed my issue.