Hi team, I'm using the `nixtlar` R package. Ever...
# timegpt
v
Hi team, I'm using the
nixtlar
R package. Every now and then I get this error:
Copy code
fcst <- nixtla_client_forecast
    df = data_tbl,
    h = horizon,
    id_col = "unique_id",
    time_col = "ds",
    target_col = "y",
    finetune_steps = 50,
    model = "timegpt-1-long-horizon",
    X_df = x_df
    )
Frequency chosen: D
Error in `httr2::req_perform()`:
! Failed to perform HTTP request.
Caused by error in `curl::curl_fetch_memory()`:
! Timeout was reached: [<http://dashboard.nixtla.io|dashboard.nixtla.io>] SSL/TLS connection timeout
Then I run exactly the same code few seconds later and everything works. Is this problem with the R package or the TimeGPT api? I'm planning to use TimeGPT for a client of mine which needs updates every day. I will schedule the code to run so it's not like I'm monitoring the process. I'm a bit scared that every now and then the client won't get his updatd forecast because I got an error. I could add some retry mechanism but I'm curious if this is something that could be fixed.
I think this is more likely to happen when I use finetune, not sure though, have to do more tests.
I will create some reproducible examples if possible and post here or on GH.
m
Hi @Vidar Ingason, thanks so much. I think @Mariana Menchero might be able to help.
m
Hey @Vidar Ingason I'm going to add more retries to the forecast function so if there is an error on the server, nixtlar can try again instead of stopping. And as I mentioned a week ago, we're in the final stages before submitting to CRAN again, so the new version should be more robust and production ready.
v
Hi @Mariana Menchero, one more question 🙂 I've attached a screenshot of my dataset (data_tbl) and the forecast made by TimeGPT using nixtlar. My data is monthly and the date is always first day of each month. The output from TimeGPT is the last day of each month. Is this intentional? It is causing error if I'm using first day of month for the future_data which I pass to x_df argument. But if I create my future data using last day of month then it works, i.e. I have to change my date variable by subtracting 1 day.
Copy code
future_tbl <- data_tbl %>% 
  future_frame(.date_var = ds, .length_out = 12) %>%
  mutate(month = month(ds), unique_id = "id") %>% 
  mutate(ds = ds - days(1))
m
Hi @Vidar Ingason please make as many questions as you need. Can you try specifying the frequency as "MS" (month start)? The output of TimeGPT I'm getting starts on the first day of the month. Furthermore, please make sure to install the latest version of
nixtlar
as I made some changes recently and will do some more once I incorporate the retry functionality to prevent the error you mentioned before.