-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added templates for vignettes to test GitHub Actions and fix previous…
… issue.
- Loading branch information
Showing
8 changed files
with
36,569 additions
and
6,320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: "Historical Forecast" | ||
output: rmarkdown::html_vignette | ||
vignette: > | ||
%\VignetteIndexEntry{Historical Forecast} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
%\VignetteEncoding{UTF-8} | ||
--- | ||
```{r setup, include=FALSE} | ||
library(httptest2) | ||
start_vignette("mocks") | ||
options("TIMEGPT_TOKEN"="dummy_token") | ||
options(digits=7) | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>", | ||
fig.width = 7, | ||
fig.height = 4 | ||
) | ||
``` | ||
|
||
```{r} | ||
library(nixtlar) | ||
``` | ||
|
||
## 1. TimeGPT Historical Forecast | ||
|
||
```{r} | ||
df <- nixtlar::electricity | ||
head(df) | ||
``` | ||
|
||
```{r} | ||
timegpt_fitted_values <- timegpt_historic(df, id_col = "unique_id", level = c(80,95)) | ||
head(timegpt_fitted_values) | ||
``` | ||
|
||
## 2. Plot TimeGPT forecast | ||
`nixtlar` includes a function to plot the historical data and any output from `timegpt_forecast`, `timegpt_historic`, `timegpt_anomaly_detection` and `timegpt_cross_validation`. If you have long series, you can use `max_insample_length` to only plot the last N historical values (the forecast will always be plotted in full). | ||
|
||
```{r} | ||
timegpt_plot(df, timegpt_fitted_values, id_col = "unique_id", max_insample_length = 200) | ||
``` | ||
|
||
```{r, include=FALSE} | ||
end_vignette() | ||
``` | ||
|
||
|
||
|
||
|
221 changes: 0 additions & 221 deletions
221
vignettes/mocks/0/dashboard.nixtla.io/api/timegpt_multi_series-8060f6-POST.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.