Skip to main content

Forecasting time series with scikit-learn regressors. It also works with any regressor compatible with the scikit-learn API (pipelines, CatBoost, LightGBM, XGBoost, Ranger...).

Project description

Python PyPI codecov Build status Maintenance License Downloads

skforecast

logo-skforecast

Time series forecasting with scikit-learn regressors.

Skforecast is a python library that eases using scikit-learn regressors as multi-step forecasters. It also works with any regressor compatible with the scikit-learn API (pipelines, CatBoost, LightGBM, XGBoost, Ranger...).

Why use Skforecast?

Skforecast is developed according to the following priorities:

  • Fast and robust prototyping.
  • Validation and backtesting methods to have a realistic assessment of model performance.
  • Models must be deployed in production.
  • Models must be interpretable.

Documentation: https://joaquinamatrodrigo.github.io/skforecast/

Installation

The default installation of skforecast only installs hard dependencies.

pip install skforecast

Specific version:

pip install skforecast==0.7.0

Latest (unstable):

pip install git+https://github.com/JoaquinAmatRodrigo/skforecast#master

Install the full version (all dependencies):

pip install skforecast[full]

Install optional dependencies:

pip install skforecast[sarimax]
pip install skforecast[plotting]

Dependencies

  • Python >= 3.8

Hard dependencies

  • numpy>=1.20, <1.25
  • pandas>=1.2, <1.6
  • tqdm>=4.57.0, <4.65
  • scikit-learn>=1.0, <1.3
  • optuna>=2.10.0, <3.2
  • joblib>=1.1.0, <1.3.0

Optional dependencies

  • matplotlib>=3.3, <3.8
  • seaborn>=0.11, <0.13
  • statsmodels>=0.12, <0.14
  • pmdarima>=2.0, <2.1

Features

  • Create recursive autoregressive forecasters from any regressor that follows the scikit-learn API
  • Create direct autoregressive forecasters from any regressor that follows the scikit-learn API
  • Create multi-series autoregressive forecasters from any regressor that follows the scikit-learn API
  • Include exogenous variables as predictors
  • Include custom predictors (rolling mean, rolling variance ...)
  • Multiple backtesting methods for model validation
  • Grid search, random search and bayesian search to find optimal lags (predictors) and best hyperparameters
  • Include custom metrics for model validation and grid search
  • Prediction interval estimated by bootstrapping and quantile regression
  • Get predictor importance
  • Forecaster in production

What is new in skforecast 0.7.0?

  • Predict and plot the distribution of each predicted step, predict_dist and plot_prediction_distribution (Ridgeline plot).
  • A class for ARIMA models with pmdarima, ForecasterSarimax, model_selection_sarimax.
  • Modeling multiple time series simultaneously with a custom function to create predictors, ForecasterAutoregMultiSeriesCustom.
  • python 3.11 compatibility.
  • Bug fixes and performance improvements.

Visit the changelog to view all notable changes.

Documentation

The documentation for the latest release is at skforecast docs.

Recent improvements are highlighted in the release notes.

Examples and tutorials

English

Español

Donating

If you found skforecast useful, you can support us with a donation. Your contribution will help to continue developing and improving this project. Many thanks!

paypal

Citation

If you use this software, please cite it using the following metadata.

APA:

Amat Rodrigo, J., & Escobar Ortiz, J. skforecast (Version 0.7.0) [Computer software]

BibTeX:

@software{skforecast,
author = {Amat Rodrigo, Joaquin and Escobar Ortiz, Javier},
license = {MIT},
month = {3},
title = {{skforecast}},
version = {0.7.0},
year = {2023}
}

View the citation file.

License

joaquinAmatRodrigo/skforecast is licensed under the MIT License, a short and simple permissive license with conditions only requiring the preservation of copyright and license notices. Licensed works, modifications and larger works may be distributed under different terms and without source code.

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

skforecast-0.7.0.tar.gz (30.6 MB view details)

Uploaded Source

Built Distribution

skforecast-0.7.0-py2.py3-none-any.whl (343.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file skforecast-0.7.0.tar.gz.

File metadata

  • Download URL: skforecast-0.7.0.tar.gz
  • Upload date:
  • Size: 30.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for skforecast-0.7.0.tar.gz
Algorithm Hash digest
SHA256 faa4303cb2524909b5a2a8a0169ace498fa43141a2cdbdd9cb437dbc8b5f8f6c
MD5 3ed0be2f7125dcb8f476160d3f6dabba
BLAKE2b-256 19595292ed5a301bc784a7ee0a607d0539a81a9a02224617a51009441cf04c10

See more details on using hashes here.

File details

Details for the file skforecast-0.7.0-py2.py3-none-any.whl.

File metadata

  • Download URL: skforecast-0.7.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 343.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for skforecast-0.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6625f1798ee1936175f74145c6830297fc91aaf3c7dbd4f40c42008e9164ac8e
MD5 16b028bdb8926240469d9df5b18a816a
BLAKE2b-256 7ade8a561ac108bdb605da47cd5a34b68663e6ee744ec0f020a46bce15862d47

See more details on using hashes here.

Supported by

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