Simple probabilistic time series benchmark models
Project description
tablespoon
Time-series Benchmarks methods that are Simple and Probabilistic
Documentation and quick links
- Introduction
- Why Run Simple Methods
- Goals of this package
- Non-Goals
- Forecast Method Documentation
- Installation
- Quick Example
- Recommended probabilistic forecasting packages
- Learn more about forecasting
Introduction
Many methods exist for probabilistic forecasting. If you are looking for impressive probabilistic forecasting package see the list of recommendation at the bottom of this README. It is expected that this package may be used as a compliment to what is already out there.
This package does not introduce new forecasting models. Instead, this package focuses on making existing simple forecasting methods accessible.
To often we see that forecast method go in production without a naive method to accompany it. In our eyes we see that this is a missed opportunity.
Why Run Simple Methods
This package does not introduce new forecasting models. It is fantastically ordinary. We have found, by experience, many good uses for the methods in this package.
- Naive May Be Good Enough: Some applications do not need anything more impressive than a simple forecasting method.
- Get A Denominator for Relative Metrics: Though naive methods can usually be beat it is good to know the relative improvement over the benchmark. This can allow a forecasting team to market their alternative forecast when the 'skill score' is impressive.
- Easy to productionize and expectations: Get a sense for how good is good enough. In many applications a forecast team is asked to forecast, but stakeholders provide no line-in-the-sand for when the forecasting work needs to stop. One reasonable approach is to run the benchmarks found in this package in beat the best performing benchmark by a margin that is statistically significant.
- Resistance in Production - Why not have many models?: Sometimes, despite out best efforts our production model does something unexpected. In this case it is nice to have a simple backup that is cheap to generate and good enough to fall back on. In this way a production forecast pipeline gains strength from a diversity of models.
- Easy Uncertainty Quantification: More and more we see that application are not about forecast accuracy, but instead about forecasting uncertainty. Capturing the full distribution helps firms set "service levels" aka percentiles of the distribution for which they are prepared to serve. Even if you have the worlds most accurate unbiased forecast the median point is an underforecast half the time. For this reason it is best to provide a distribution of simulated future values and the firm may decide for themselves what risks they are or are not willing to take.
Goals of this package
- Simplicity: Not just in the forecasts themselves, but also from the users perspective.
- Accessability: Because of how important we feel simple forecasting
methods are we want as many front end binding as possible to expose these
methods to the largest audience possible. We eventually have binding in
Shell
,Julia
,R
, andPython
. - Stability: We want this package to feel rock solid. For this to happen we keep the feature set relatively small. We believe that after the initial development of this package we should spend out time maintaining the code as oppose to thinking of new features.
- Distributional Forecasts: Quantification of uncertainty is the name of the game.
- Documentation: It should be very clear exactly how forecasts are getting generated. We document the parameterization of the models to make this as obvious and uninteresting as possible.
Non-Goals
- Circut Melting Speeds: Not to say this is a slow package. In fact, all models do get compiled.
- New Forecast Models: Again, this is out of scope. If you are looking for recommendations please see the bottom of the page.
Installation
Python
The reccomended way to install is with poetry
git clone https://github.com/well-made-spoon/tablespoon.git
cd tablespoon
poetry build
Quick Example
We show a quick example below. For more examples see EXAMPLES.md
import numpy as np
import pandas as pd
from tablespoon import Naive, Mean, Snaive
# pull and clean data
# columns must have the columns "ds" and "y"
df = (
pd.read_csv("https://storage.googleapis.com/data_xvzf/m5_state_sales.csv")
.query("state_id == 'CA'")
.rename(columns={"date": "ds", "sales": "y"})
.assign(y=lambda df: np.log(df.y))
)
m = Naive()
forecast = m.predict(df, horizon=10)
print(forecast.head())
Recommended probabilistic forecasting packages
There are many packages that can compliment tablespoon
forecast: The king of forecasting packages. Rob Hyndman is a professor of forecasting and has served as editor of the journal "International Journal of Forecasting". If you are new to forecasting please read his free ebook fpp3.
prophet: A very capable and reliable forecasting package. I have never seen a bad forecast come out of prophet.
gluonts. If you are itching to use neural nets for forecasting this is a good one to pick.
Learn more about forecasting
- Read fpp3
- Join the International Institute of Forecasting and read their publications.
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 Distribution
Built Distribution
Hashes for tablespoon-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ff687bc477e1062275859314d7a7ac942ef06ae6a9454f2ab7a6726ff3f8f66 |
|
MD5 | 4a730b2c8805d704d853b609ecb2e697 |
|
BLAKE2b-256 | ce4a3b55c50ec92d1a3432a48159f43a9f78590b3c33ea28dd75a31672971871 |