This module performs time series forecasting using Kedro pipelines.
Project description
Take Forecast
A time series forecasting library that uses Kedro pipelines.
For performing the forecast, there are four main steps:
-
Tune: Analyse the time series to find seasonality, unit roots, memory lags and stochastic process lags.
-
Fit: Fit a SARIMA model with hyperparameters obtained in the last step and input data.
-
Predict: Make forecast using the fitted model. Also provide upper and lower boundaries for confidence interval.
-
Evaluate: Assess the model quality by error metrics evaluated in train and test sets.
Installation
Use pip to install:
pip install take-forecast
Usage
A simple example using take_forecast
.
import numpy as np
import pandas as pd
from take_forecast import ProjectContext
np.random.seed(0)
samples = 60
x = 100 + 80 * np.linspace(0, 1, samples) + 20 * np.random.randn(samples)
y = x[:-3] + x[1:-2] + x[2:-1] + x[3:]
date_end = pd.Timestamp.now()
date_start = date_end - pd.Timedelta(len(y) - 1, 'd')
index = pd.date_range(date_start, date_end, freq='d')
ts = pd.Series(y, index)
context = ProjectContext()
results = context.run_forecast(ts)
The results
are informed as a report in a dict with following keys:
- forecast: Prediction
- forecast_lower: Lower limit
- forecast_upper: Upper limit
- alpha: Significance level
- error_metrics_report: Train and test error metrics
- model: Fitted SARIMA model
Author
Take Blip - Data & Analytics - Research Tribe - Squad XD
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for take_forecast-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9349aa31c86cd1f87df8c1a83daa8cd6ea9e7118229ffdd01fc5abec54b3cc2 |
|
MD5 | b5c4729c65fe517937556b62c8f592aa |
|
BLAKE2b-256 | 6d858bbb1c5617a38a3e540c2d85a17154d6329991f51e2fea85e4f4a25b3537 |