Python library for time series forecasting using scikit-learn compatible models, statistical methods, and foundation models.
Actively maintained. Last release 3 weeks ago, commits in 25 of the last 26 weeks. A safe choice.
pip install skforecastPython library for time series forecasting using scikit-learn compatible models, statistical methods, and foundation models.
Actively maintained. Last release 3 weeks ago, commits in 25 of the last 26 weeks. A safe choice.
pip install skforecastTime series forecasting, from prototype to production. Skforecast is a Python library for time series forecasting using scikit-learn compatible models, statistical methods, and foundation models. It works with any estimator compatible with the scikit-learn API, such as LightGBM, XGBoost, CatBoost or Keras.
Backtesting of LightGBM, Chronos-2 and ARIMA on daily electricity demand, with temperature and holidays as exogenous variables. Real skforecast outputs, from the animation on skforecast.org.
pip install skforecast
Also available on conda-forge (conda install -c conda-forge skforecast). Optional dependencies for statistical models, plotting and deep learning are listed in the installation guide.
from lightgbm import LGBMRegressor
from skforecast.recursive import ForecasterRecursive
from skforecast.datasets import load_demo_dataset
# Download demo dataset
y = load_demo_dataset()
# Create and fit the forecaster using the last 15 observations as features
forecaster = ForecasterRecursive(
estimator = LGBMRegressor(random_state=123, verbose=-1),
lags = 15
)
forecaster.fit(y=y)
# Predict the next 12 months
predictions = forecaster.predict(steps=12)
predictions.head()
# 2008-07-01 0.976355
# 2008-08-01 1.038296
# 2008-09-01 1.108676
# 2008-10-01 1.163778
# 2008-11-01 1.169646
# Freq: MS, Name: pred, dtype: float64
# pip install chronos-forecasting
from skforecast.foundation import FoundationModel, ForecasterFoundation
from skforecast.datasets import load_demo_dataset
# Download demo dataset
y = load_demo_dataset()
# Create the forecaster: fit only stores the context, there is no training
forecaster = ForecasterFoundation(
estimator = FoundationModel("autogluon/chronos-2-small")
)
forecaster.fit(series=y)
# Predict the next 12 months
predictions = forecaster.predict(steps=12)
predictions.head()
# level pred
# 2008-07-01 y 1.002536
# 2008-08-01 y 1.030961
# 2008-09-01 y 1.083664
# 2008-10-01 y 1.184066
# 2008-11-01 y 1.170530
Train, predict, tune and backtest the same way, whatever the model: see them compared on three datasets.
All forecasters share the same API for training, prediction, backtesting and probabilistic forecasting.
| Forecaster | Estimator | Series | Strategy | Exog | Window features | Differentiation |
|---|---|---|---|---|---|---|
| ForecasterRecursive | scikit-learn regressor | single | recursive | ✓ | ✓ | ✓ |
| ForecasterDirect | scikit-learn regressor | single | direct | ✓ | ✓ | ✓ |
| ForecasterRecursiveMultiSeries | scikit-learn regressor | multiple | recursive | ✓ | ✓ | ✓ |
| ForecasterDirectMultiVariate | scikit-learn regressor | multiple | direct | ✓ | ✓ | ✓ |
| ForecasterFoundation | pre-trained, zero-shot | single or multiple | multi-output | ✓ | ||
| ForecasterStats | Arima, Sarimax, Ets, Arar | single | recursive | ✓ | ||
| ForecasterRnn | Keras model (RNN/LSTM) | single or multiple | multi-output | ✓ | ||
| ForecasterRecursiveClassifier | scikit-learn classifier | single | recursive | ✓ | ✓ | |
| ForecasterEquivalentDate | Rule-based (baseline) | single | recursive |
The full documentation is available at https://skforecast.org.
| Documentation | |
|---|---|
| :book: Introduction to forecasting | Forecasting concepts and how to choose a forecaster |
| :rocket: Quick start | Install skforecast and train your first model |
| :hammer_and_wrench: User guides | Detailed guides on every feature |
| :mortar_board: Examples and tutorials | Practical examples, in English, Spanish and Chinese |
| :question: FAQ and tips | Answers and tips about forecasting |
| :books: API Reference | Reference for all functions and classes |
| :memo: Releases | What changed in each version |
https://skforecast.org/latest/llms-full.txt into any LLM, or install the workflow skills in your coding agent: as a Claude Code plugin (/plugin marketplace add skforecast/skforecast) or with npx skills add skforecast/skforecast/skills for Cursor, Copilot, Codex and others. Learn more in AI-assisted forecasting.pip install skforecast-ai. It also brings skforecast to coding agents such as Claude Code or VS Code through an MCP server: ask in plain language and get the forecast, its backtesting metrics and the skforecast script that produced them.Bug reports, feature requests, code, tests, documentation and examples are all welcome. Open an issue on GitHub Issues or read the Contribution Guide to get started.
skforecast is created and maintained by Joaquín Amat Rodrigo and Javier Escobar Ortiz, together with everyone who has contributed to it (about the project).
If you use skforecast in a scientific publication, please cite the version you used: each version has its own DOI and ready-made citations on Zenodo. To cite skforecast in general, use the DOI that always resolves to the latest release.
APA:
Amat Rodrigo, J., & Escobar Ortiz, J. skforecast [Computer software]. https://doi.org/10.5281/zenodo.8382787
BibTeX:
@software{skforecast,
author = {Amat Rodrigo, Joaquin and Escobar Ortiz, Javier},
title = {skforecast},
license = {BSD-3-Clause},
url = {https://skforecast.org/},
doi = {10.5281/zenodo.8382787}
}
The citation metadata is also in CITATION.cff (GitHub's "Cite this repository" button). skforecast is used in 70+ scientific publications: see them on Google Scholar.
skforecast is free, open-source software supported by the Sovereign Tech Fund and by the organizations that sponsor it. If your company relies on skforecast, see Sponsorship and funding for sponsorship tiers, support agreements, feature sponsorship and training.
Individuals can support the project through Open Collective, Buy Me a Coffee, GitHub Sponsors (Joaquín Amat Rodrigo, Javier Escobar Ortiz) or PayPal.
Skforecast software: BSD-3-Clause License
Skforecast documentation: CC BY-NC-SA 4.0
Trademark: The trademark skforecast is registered with the European Union Intellectual Property Office (EUIPO) under the application number 019109684. Unauthorized use of this trademark, its logo, or any associated visual identity elements is strictly prohibited without the express consent of the owner.
Use instead of skforecast: tools that do the same job, closest first.
Compare with mlforecast →Compare with statsforecast →Compare with sktime →Compare all 4 →
Scalable machine learning based time series forecasting
Time series forecasting suite using statistical models
A unified framework for machine learning with time series
Time series forecasting suite using deep learning models
Probabilistic time series modeling in Python.
Automatic Forecasting Procedure
Use together with skforecast: extensions, drivers, servers and companion tools.