Skip to main content

Time series forecasting suite using statistical models

Project description

Nixtla   Tweet  Slack

All Contributors

Statistical ⚡️ Forecast

Lightning fast forecasting with statistical and econometric models

CI Python PyPi conda-nixtla License: MIT docs

StatsForecast offers a collection of widely used univariate time series forecasting models, including automatic ARIMA and ETS modeling optimized for high performance using numba. It also includes a large battery of benchmarking models.

💻 Installation and Getting Started

PyPI

You can install the released version of StatsForecast from the Python package index with:

pip install statsforecast

(Installing inside a python virtualenvironment or a conda environment is recommended.)

Conda

Also you can install the released version of StatsForecast from conda with:

conda install -c conda-forge statsforecast

(Installing inside a python virtualenvironment or a conda environment is recommended.)

Dev Mode If you want to make some modifications to the code and see the effects in real time (without reinstalling), follow the steps below:
git clone https://github.com/Nixtla/statsforecast.git
cd statsforecast
pip install -e .

To get started just follow this guide.

🎉 New!

  • Open In Colab ETS Example: 4x faster than StatsModels with improved accuracy and robustness.
  • Open In Colab Complete pipeline and comparison: 20x faster than pmdarima and 500x faster than Prophet.

🔥 Highlights

  • Fastest and most accurate auto_arima in Python and R.

  • Fastest and most accurate ets in Python and R.

  • Replace FB-Prophet in two lines of code and gain speed and accuracy. Check the experiments here.

  • Distributed computation in clusters with ray. (Forecast 1M series in 30min)

  • Good Ol' sklearn interface with AutoARIMA().fit(y).predict(h=7).

🎊 Features

  • Inclusion of exogenous variables and prediction intervals for ARIMA.

  • 20x faster than pmdarima.

  • 1.5x faster than R.

  • 500x faster than Prophet.

  • 4x faster than statsmodels.

  • Compiled to high performance machine code through numba.

  • 1,000,000 series in 30 min with ray.

  • Out of the box implementation of ses, adida, historic_average, croston_classic, croston_sba, croston_optimized, seasonal_window_average, seasonal_naive, imapa naive, random_walk_with_drift, window_average, seasonal_exponential_smoothing, tsb, auto_arima and ets.

Missing something? Please open an issue or write us in Slack

📖 Why?

Current Python alternatives for statistical models are slow, inaccurate and don't scale well. So we created a library that can be used to forecast in production environments or as benchmarks. StatsForecast includes an extensive battery of models that can efficiently fit millions of time series.

🔬 Accuracy & ⏲ Speed

ARIMA

The auto_arima model implemented in StatsForecast is 20x faster than pmdarima and 1.5x faster than R while improving accuracy. You can see the exact comparison and reproduce the results here.

ETS

StatsForecast's exponential smoothing is 4x faster than StatsModels' and 1.6x faster than R's, with improved accuracy and robustness. You can see the exact comparison and reproduce the resultshere

Benchmarks at Scale

With StatsForecast you can fit 9 benchmark models on 1,000,000 series in under 5 min. Reproduce the results here.

🧬 Getting Started

You can run this notebooks to get you started.

  • Example of different auto_arima models on M4 data Open In Colab

    • In this notebook we present Nixtla's auto_arima. The auto_arima model is widely used to forecast time series in production and as a benchmark. However, the alternative python implementation (pmdarima) is so slow that prevents data scientists from quickly iterating and deploying auto_arima in production for a large number of time series.
  • Shorter Example of fitting and auto_arima and an ets model. Open In Colab

  • Benchmarking 9 models on millions of series.

📖 Documentation (WIP)

Here is a link to the documentation.

🔨 How to contribute

See CONTRIBUTING.md.

📃 References

  • The auto_arima model is based (translated) from the R implementation included in the forecast package developed by Rob Hyndman.
  • The ets model is based (translated) from the R implementation included in the forecast package developed by Rob Hyndman.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


fede

💻

José Morales

💻 🚧

Sugato Ray

💻

Jeff Tackes

🐛

darinkist

🤔

Alec Helyar

💬

Dave Hirschfeld

💬

mergenthaler

💻

Kin

💻

Yasslight90

🤔

asinig

🤔

Philip Gillißen

💻

Sebastian Hagn

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

statsforecast-0.7.1.tar.gz (48.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statsforecast-0.7.1-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file statsforecast-0.7.1.tar.gz.

File metadata

  • Download URL: statsforecast-0.7.1.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for statsforecast-0.7.1.tar.gz
Algorithm Hash digest
SHA256 dac2dc63abbae63760520e0a0e7657fed58a8b398938961e0ae6f4a5502e59f0
MD5 8e47f8aa13593ea19c36a5f4d99ecd57
BLAKE2b-256 c94b0d8837c28fa9a5d90f0d446a5e1abf376420508b470b0b520a1a63526908

See more details on using hashes here.

File details

Details for the file statsforecast-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: statsforecast-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for statsforecast-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be0c57283029d719105f51b519daa5a386e769e3c252cd74d80e8e9471e03301
MD5 b80e80b5d7ecfa569719d1f11f99d76e
BLAKE2b-256 3d7a88ee0fea4f0ba8ade54b6087397543715eac84ab400e593c34f14f4fd7d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page