Skip to content

Commit d29048f

Browse files
committedFeb 17, 2025·
fix: resolve issue with detect_anomalies and minor changes to docs
1 parent 410700e commit d29048f

17 files changed

+839
-270
lines changed
 

‎DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Description: A Software Development Kit for working with 'Nixtla''s 'TimeGPT', a
1414
License: Apache License (>= 2.0)
1515
Encoding: UTF-8
1616
Roxygen: list(markdown = TRUE)
17-
RoxygenNote: 7.2.3
17+
RoxygenNote: 7.3.2
1818
Depends:
1919
R (>= 2.10)
2020
LazyData: true

‎R/nixtla_client_cross_validation.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#' Sequential version of 'nixtla_client_cross_validation'
2-
#' This is a private function of 'nixtlar'
1+
#' `TimeGPT` cross-validation
32
#'
43
#' @param df A data frame with time series data.
54
#' @param h Forecast horizon.

‎R/nixtla_client_detect_anomalies.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#' Sequential version of 'nixtla_client_detect_anomalies'
2-
#' This is a private function of 'nixtlar'
1+
#' `TimeGPT` detect anomalies
32
#'
43
#' @param df A data frame with time series data.
54
#' @param freq Frequency of the data.
@@ -132,7 +131,7 @@ nixtla_client_detect_anomalies <- function(df, freq=NULL, id_col="unique_id", ti
132131
dplyr::group_by(.data$unique_id) |>
133132
dplyr::group_split()
134133

135-
df_tail <- purrr::map2_dfr(grouped_df_list, unique(df_info$fitted_sizes), ~slice_tail(.x, n = .y))
134+
df_tail <- purrr::map2_dfr(grouped_df_list, df_info$fitted_sizes, ~slice_tail(.x, n = .y))
136135

137136
nch <- nchar(df_tail$ds[1])
138137
if(nch <= 10){

‎R/nixtla_client_forecast.R

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#' Sequential version of 'nixtla_client_forecast'
2-
#' This is a private function of 'nixtlar'
1+
#' `TimeGPT` forecast
32
#'
43
#' @param df A data frame with time series data.
54
#' @param h Forecast horizon.
@@ -293,7 +292,7 @@ nixtla_client_forecast <- function(df, h=8, freq=NULL, id_col="unique_id", time_
293292
}
294293

295294
dates_long_df <- dates_long_df |>
296-
dplyr::arrange(.data$unique_id)
295+
dplyr::arrange(.data$unique_id)
297296

298297
forecast <- cbind(dates_long_df, fc)
299298

@@ -323,7 +322,7 @@ nixtla_client_forecast <- function(df, h=8, freq=NULL, id_col="unique_id", time_
323322
finetune_depth=finetune_depth,
324323
finetune_loss=finetune_loss,
325324
clean_ex_first=clean_ex_first
326-
)
325+
)
327326

328327
forecast <- dplyr::bind_rows(fitted, forecast)
329328
}

‎R/nixtla_client_historic.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#' Sequential version of 'nixtla_client_historic'
2-
#' This is a private function of 'nixtlar'
1+
#' `TimeGPT` historic forecast
32
#'
43
#' @param df A tsibble or a data frame with time series data.
54
#' @param freq Frequency of the data.

‎man/nixtla_client_cross_validation.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎man/nixtla_client_detect_anomalies.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎man/nixtla_client_forecast.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎man/nixtla_client_historic.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎nixtlaR.Rproj

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: ca86021f-c038-40e9-bfb8-ddf11abd4e3d
23

34
RestoreWorkspace: No
45
SaveWorkspace: No
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"input_tokens": 85080,
3+
"output_tokens": 120,
4+
"finetune_tokens": 0,
5+
"mean": [
6+
47.05948,
7+
49.2811,
8+
50.786232,
9+
50.800903,
10+
49.80066,
11+
51.497253,
12+
52.020813,
13+
53.910717,
14+
54.81732,
15+
56.888443,
16+
54.694492,
17+
54.15711,
18+
53.05413,
19+
53.414883,
20+
54.19707,
21+
54.60037,
22+
59.234734,
23+
60.023224,
24+
55.22892,
25+
48.512203,
26+
51.469536,
27+
53.43322,
28+
53.537262,
29+
51.826675,
30+
-27.75719,
31+
-27.913132,
32+
-28.211796,
33+
-28.810095,
34+
-27.907024,
35+
-27.640638,
36+
-27.676228,
37+
-26.66798,
38+
-26.83917,
39+
-25.48255,
40+
-26.061874,
41+
-26.585987,
42+
-27.087431,
43+
-27.66879,
44+
-27.338823,
45+
-26.570395,
46+
-25.710356,
47+
-25.111683,
48+
-24.808588,
49+
-24.686651,
50+
-23.568918,
51+
-25.699728,
52+
-26.651564,
53+
-27.942074,
54+
64.57185,
55+
65.58143,
56+
65.14525,
57+
64.89398,
58+
62.981873,
59+
65.36322,
60+
66.913956,
61+
69.469055,
62+
68.640015,
63+
70.03793,
64+
67.664474,
65+
66.10207,
66+
65.07356,
67+
62.830975,
68+
62.535202,
69+
61.945793,
70+
66.3739,
71+
68.38097,
72+
65.30461,
73+
59.633972,
74+
64.35616,
75+
67.64073,
76+
67.20606,
77+
63.724087,
78+
51.859756,
79+
51.88111,
80+
51.894783,
81+
51.821037,
82+
51.807297,
83+
51.853058,
84+
51.942238,
85+
51.96409,
86+
51.856926,
87+
51.708946,
88+
51.73094,
89+
51.60405,
90+
51.599693,
91+
51.468937,
92+
51.384018,
93+
51.224514,
94+
51.020195,
95+
51.214714,
96+
51.432236,
97+
51.42369,
98+
51.60919,
99+
51.60258,
100+
51.60228,
101+
51.521454,
102+
24.89881,
103+
25.9897,
104+
26.135288,
105+
27.016626,
106+
28.175583,
107+
26.539783,
108+
25.56105,
109+
25.664215,
110+
27.217247,
111+
27.094715,
112+
25.673601,
113+
24.59826,
114+
24.126513,
115+
24.002203,
116+
23.67225,
117+
23.219694,
118+
23.433764,
119+
29.063866,
120+
28.252031,
121+
28.035812,
122+
27.629639,
123+
25.34159,
124+
23.499353,
125+
24.88516
126+
],
127+
"intervals": null,
128+
"weights_x": [
129+
80.0,
130+
63.0,
131+
53.0,
132+
52.0,
133+
44.0,
134+
28.0,
135+
26.0,
136+
1332.0,
137+
1322.0
138+
],
139+
"feature_contributions": null,
140+
"request_id": "RV74JU7M3Q"
141+
}

0 commit comments

Comments
 (0)
Please sign in to comment.