Logo

The Data Daily

Simple interfaces to the forecasting API | R-bloggers

Simple interfaces to the forecasting API | R-bloggers

Simple interfaces to the forecasting API
Posted on November 22, 2022 by T. Moudiki in R bloggers | 0 Comments
[This article was first published on T. Moudiki's Webpage - R , and kindly contributed to R-bloggers ]. (You can report issue about the content on this page here )
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
So far, as of 2022-11-23, this API contains four methods for univariate time series forecasting (with prediction intervals):
mean a (not so naïve) benchmark method, whose prediction is the sample mean.
rw a (not so naïve) benchmark method, whose prediction is the last value of the input time series.
theta is the forecasting method described in [1] and [2], which won the M3 competition.
prophet is a popular model described in [3].
In this post, I’ll present two packages, one implemented in R and one in Python, which are designed for smoothing users’ interaction with the API. You can create similar high-level packages in other programming languages, by using this tool and this page .
Content
0 – Install packages in R or Python
1 – Create an account with create_account
2 – Get a token for authentication using get_token
3 – Requests for forecasts with get_forecast
0 – Install packages in R or Python:
In Python
1 – Create an account with create_account:
In Python
import forecastingapi as fapi res_create_account = fapi.create_account(username=" [email protected] ", password="pwd") # choose a better password print(res_create_account)
In R
forecastingAPI::create_account(username = " [email protected] ", password = "pwd") # choose a better password
2 – Get a token for authentication using get_token
In Python
token = fapi.get_token(username = " [email protected] ", password = "pwd") print(token)
In R
token

Images Powered by Shutterstock