Tracy Teal
08/29/2024, 4:25 PMTracy Teal
08/29/2024, 4:25 PMMariana Menchero
08/29/2024, 5:38 PMMariana Menchero
08/29/2024, 5:38 PMTracy Teal
08/30/2024, 9:32 PMMariana Menchero
08/30/2024, 9:37 PMTracy Teal
08/30/2024, 9:38 PMMariana Menchero
08/30/2024, 9:42 PMread_excel
, which loads the data as tibble. No support for that on CRAN, but yes on the dev version on GitHub.
However:
1. They use a sequence 1,2,3,… as unique_ids, so instead of having one series with 260 observations, nixtlar
thinks it’s 260 series with 1 observation each.
2. Frequency is seconds (!), so they need to specify it since nixtlar
can only deduce hourly and above.
3. When using as.Date()
, the hms part disappears.
And even after making the necessary changes, the call still fails 🤦♀️ I’m currently looking into it, and for the time being, we can tell them that.Tracy Teal
08/30/2024, 9:43 PMMariana Menchero
08/30/2024, 9:43 PMMariana Menchero
08/30/2024, 9:44 PMTracy Teal
08/30/2024, 9:44 PMTracy Teal
08/30/2024, 9:44 PMMariana Menchero
09/02/2024, 10:13 PMnixtlar
, so please ask the user to download the development version:
devtools::install_github("Nixtla/nixtlar")
For this particular case, it is better to build a new data frame, specifying the format of the data, which is taken every second.
Y_df <- readxl::read_excel("path/to/data/Output_Fyz_rev.xlsx", sheet = 1)
df <- data.frame(
unique_id = "id",
ds = seq(as.POSIXct(Y_df$ds[1]), by = "1 sec", length.out = nrow(Y_df)),
y = as.numeric(Y_df$y)
)
df$ds <- format(df$ds, format = "%Y-%m-%d %H:%M:%S")
Given that nixtlar
can’t deduce subhourly frequencies, it is necessary to set it directly with freq="S"
.
fc <- nixtla_client_forecast(df, h=8, id_col="unique_id", freq="S", level=c(80,95))
The forecast should look like this, same as with the Python SDK.Mariana Menchero
09/02/2024, 10:14 PMTracy Teal
09/03/2024, 3:53 PM