A few weeks ago, I introduced the R version of ahead, a package for univariate and multivariate time series forecasting. A Python version, built on top of the R version, is now available on PyPI and GitHub. Here is how to install it:
Here are the packages that will be used for this demo:
import pandas as pd # for creating Python time series data structures
import ahead as ah # might take some time installing R packages, ONLY the 1st time it's called
Univariate time series forecasting
# Input time series
dataset = {
'date' : ['2020-01-01', '2020-02-01', '2020-03-01', '2020-04-01', '2020-05-01',
'2020-06-01', '2020-07-01', '2020-08-01', '2020-09-01', '2020-10-01'],
'value' : [34, 30, 35.6, 33.3, 38.1, 39.2, 37.3, 34.5, 35.6, 35.9]}
# Data frame containing the time series
df = pd.DataFrame(dataset).set_index('date')
# For more details on EAT class parameters, visit
# https://techtonique.github.io/ahead_python/documentation/eat/
e1 = ah.EAT(h = 5)
e1.forecast(df)
print(e1.result_df_)