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

Package Python PyPI Downloads Maintenance Project Status: Active
Meta License DOI
Testing Build status codecov
Donation paypal buymeacoffee GitHub Sponsors
Affiliation NumFOCUS Affiliated

About The Project

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

Why use skforecast?

The fields of statistics and machine learning have developed many excellent regression algorithms that can be useful for forecasting, but applying them effectively to time series analysis can still be a challenge. To address this issue, the skforecast library provides a comprehensive set of tools for training, validation and prediction in a variety of scenarios commonly encountered when working with time series. The library is built using the widely used scikit-learn API, making it easy to integrate into existing workflows. With skforecast, users have access to a wide range of functionalities such as feature engineering, model selection, hyperparameter tuning and many others. This allows users to focus on the essential aspects of their projects and leave the intricacies of time series analysis to skforecast. In addition, skforecast is developed according to the following priorities:

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

Share Your Thoughts with Us

Thank you for choosing skforecast! We value your suggestions, bug reports and recommendations as they help us identify areas for improvement and ensure that skforecast meets the needs of the community. Please consider sharing your experiences, reporting bugs, making suggestions or even contributing to the codebase on GitHub. Together, let's make time series forecasting more accessible and accurate for everyone.

Documentation

For detailed information on how to use and leverage the full potential of skforecast please refer to the comprehensive documentation available at:

https://skforecast.org :books:

Installation

The default installation of skforecast only installs hard dependencies.

pip install skforecast

Specific version:

pip install skforecast==0.12.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]
pip install skforecast[deeplearning]

Dependencies

  • Python >= 3.8, <3.12

Hard dependencies

  • numpy>=1.20, <1.27
  • pandas>=1.2, <2.3
  • tqdm>=4.57, <4.67
  • scikit-learn>=1.2, <1.5
  • optuna>=2.10, <3.7
  • joblib>=1.1, <1.5

Optional dependencies

  • matplotlib>=3.3, <3.9
  • seaborn>=0.11, <0.14
  • statsmodels>=0.12, <0.15
  • pmdarima>=2.0, <2.1
  • tensorflow>=2.13, <2.16

What is new in skforecast 0.12?

Visit the release notes to view all notable changes.

  • Multiseries forecaster (Global Models) can be trained using series of different lengths and with different exogenous variables per series.
  • Bayesian hyperparameter search is now available for all multiseries forecasters using optuna as the search engine.
  • New functionality to select features using scikit-learn selectors (select_features and select_features_multiseries).
  • Added new forecaster ForecasterRnn to create forecasting models based on deep learning (RNN and LSTM).
  • New method to predict intervals conditioned on the range of the predicted values. This is can help to improve the interval coverage when the residuals are not homoscedastic (ForecasterAutoreg).
  • All Recursive Forecasters are now able to differentiate the time series before modeling it.
  • Bug fixes and performance improvements.

Forecasters

A Forecaster object in the skforecast library is a comprehensive container that provides essential functionality and methods for training a forecasting model and generating predictions for future points in time.

The skforecast library offers a variety of forecaster types, each tailored to specific requirements such as single or multiple time series, direct or recursive strategies, or custom predictors. Regardless of the specific forecaster type, all instances share the same API.

Forecaster Single series Multiple series Recursive strategy Direct strategy Probabilistic prediction Time series differentiation Exogenous features Custom features
ForecasterAutoreg :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
ForecasterAutoregCustom :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
ForecasterAutoregDirect :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
ForecasterMultiSeries :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
ForecasterMultiSeriesCustom :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
ForecasterMultiVariate :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
ForecasterRNN :heavy_check_mark: :heavy_check_mark:
ForecasterSarimax :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:

Main User Guides

Examples and tutorials

English

Español

How to contribute

Primarily, skforecast development consists of adding and creating new Forecasters, new validation strategies, or improving the performance of the current code. However, there are many other ways to contribute:

  • Submit a bug report or feature request on GitHub Issues.
  • Contribute a Jupyter notebook to our examples.
  • Write unit or integration tests for our project.
  • Answer questions on our issues, Stack Overflow, and elsewhere.
  • Translate our documentation into another language.
  • Write a blog post, tweet, or share our project with others.

For more information on how to contribute to skforecast, see our Contribution Guide.

Visit our authors section to meet all the contributors to skforecast.

Citation

If you use skforecast for a scientific publication, we would appreciate citations to the published software.

Zenodo

Amat Rodrigo, Joaquin, & Escobar Ortiz, Javier. (2024). skforecast (v0.12.0). Zenodo. https://doi.org/10.5281/zenodo.8382788

APA:

Amat Rodrigo, J., & Escobar Ortiz, J. (2024). skforecast (Version 0.12.0) [Computer software]. https://doi.org/10.5281/zenodo.8382788

BibTeX:

@software{skforecast,
author = {Amat Rodrigo, Joaquin and Escobar Ortiz, Javier},
title = {skforecast},
version = {0.12.0},
month = {5},
year = {2024},
license = {BSD-3-Clause},
url = {https://skforecast.org/},
doi = {10.5281/zenodo.8382788}
}

View the citation file.

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

License

BSD-3-Clause License

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.12.0.tar.gz (442.5 kB view details)

Uploaded Source

Built Distribution

skforecast-0.12.0-py3-none-any.whl (558.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skforecast-0.12.0.tar.gz
  • Upload date:
  • Size: 442.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for skforecast-0.12.0.tar.gz
Algorithm Hash digest
SHA256 e9f99d8f012ede1bda005e97c3e7e9b8ecd6cc69ce82746a36cd38b6095c06b5
MD5 0dfd19866e3827edacf9a08d00b1ef58
BLAKE2b-256 e0da0555c8b33f84d11ac0012bfb8c227e613bb1f78171c592c3b2b3d7ac4cdc

See more details on using hashes here.

File details

Details for the file skforecast-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: skforecast-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 558.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for skforecast-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83701b0c5f1cc96e398cb6c0f4c0f613838bfc3c4d7056aea52710f86906dac9
MD5 443463ad4a070c0324afe15e90844e9e
BLAKE2b-256 4a87e35f5f2b6d0be9f096b977ffdb33bccf6f06c20d56c9e0e1cb806907367c

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