Skip to content

Commit

Permalink
Test to fix GA issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
MMenchero committed Dec 6, 2023
1 parent d9a1b62 commit 56a3bfe
Show file tree
Hide file tree
Showing 12 changed files with 1,483 additions and 317 deletions.
2 changes: 1 addition & 1 deletion R/timegpt_anomaly_detection.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ timegpt_anomaly_detection <- function(df, freq=NULL, id_col=NULL, time_col="ds",
"content-type" = "application/json",
"authorization" = paste("Bearer", .get_token())
) |>
httr2::req_user_agent("nixtla-r") |>
httr2::req_user_agent("nixtlar") |>
httr2::req_body_json(data = timegpt_data) |>
httr2::req_perform()

Expand Down
2 changes: 1 addition & 1 deletion R/timegpt_cross_validation.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ timegpt_cross_validation <- function(df, h=8, freq=NULL, id_col=NULL, time_col="
"content-type" = "application/json",
"authorization" = paste("Bearer", .get_token())
) |>
httr2::req_user_agent("nixtla-r") |>
httr2::req_user_agent("nixtlar") |>
httr2::req_body_json(data = timegpt_data) |>
httr2::req_perform()

Expand Down
2 changes: 1 addition & 1 deletion R/timegpt_historic.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ timegpt_historic <- function(df, freq=NULL, id_col=NULL, time_col="ds", target_c
"content-type" = "application/json",
"authorization" = paste("Bearer", .get_token())
) |>
httr2::req_user_agent("nixtla-r") |>
httr2::req_user_agent("nixtlar") |>
httr2::req_body_json(data = timegpt_data) |>
httr2::req_perform()

Expand Down
2 changes: 1 addition & 1 deletion R/timegpt_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ timegpt_plot <- function(df, fcst=NULL, h=NULL, id_col=NULL, time_col="ds", targ
dplyr::ungroup()

plot <- plot+
ggplot2::geom_vline(ggplot2::aes(xintercept=.data$ds), data=cutoff, linetype="dotted", linewidth=0.6, color="#822681FF")
ggplot2::geom_vline(ggplot2::aes(xintercept=.data$ds), data=cutoff, linewidth=0.5, color="#822681FF")
}
}

Expand Down

This file was deleted.

48 changes: 48 additions & 0 deletions vignettes/cross-validation.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "Cross Validation"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{cross-validation}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
library(httptest2)
start_vignette("mocks")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 12,
fig.height = 6
)
```

```{r}
library(nixtlar)
```

## 1. Load data

```{r}
df <- read.csv('https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv')
head(df)
```

## 2. Use cross validation with TimeGPT

```{r}
timegpt_cv_df <- timegpt_cross_validation(df, h = 8, id_col = "unique_id", n_windows = 5, step_size = 2)
head(timegpt_cv_df)
```

## 3. Plot TimeGPT forecasts

```{r}
timegpt_plot(df, timegpt_cv_df, h=8, max_insample_length = 200)
```


```{r, include=FALSE}
end_vignette()
```
54 changes: 0 additions & 54 deletions vignettes/exogenous-variables.Rmd

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"message": "success",
"details": "request successful",
"code": "B10",
"requestID": "282UU84QRT",
"requestID": "9CVV6A8CAL",
"support": "If you have questions or need support, please email [email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,6 @@
"message": "success",
"details": "request successful",
"code": "B10",
"requestID": "7Y8R9P4A6E",
"requestID": "RCHQ6HA5GD",
"support": "If you have questions or need support, please email [email protected]"
}
Loading

0 comments on commit 56a3bfe

Please sign in to comment.