Skip to main content

skforecast

Package Python PyPI Conda Total downloads PyPI monthly downloads
Meta License DOI NumFOCUS Affiliated GC.OS Affiliated
Testing Build status codecov
Community !discord !linkedin Forecasting Python

About skforecast

Time 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 with skforecast on daily electricity demand

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.

Installation

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.

Quick example

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
Same workflow with a foundation model (Chronos-2, zero-shot)
# 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

Features

One API for every kind of model

  • Machine learning: any scikit-learn compatible regressor, such as LightGBM, XGBoost or CatBoost, with lags, rolling and calendar features. Recursive or direct strategies, for one series or thousands.
  • Foundation models: zero-shot forecasting with pre-trained models such as Chronos-2, TimesFM, Moirai-2 or TabPFN-TS, without training them.
  • Statistical models: ARIMA, SARIMAX, ETS and ARAR, with automatic model selection.
  • Deep learning: recurrent neural networks (RNN, LSTM) built with Keras.

Train, predict, tune and backtest the same way, whatever the model: see them compared on three datasets.

Built for production

  • Backtesting that reproduces how the model will be used: refits, gaps, fold strides, fixed or expanding windows.
  • Probabilistic forecasting with bootstrapping, conformal prediction and quantiles, evaluated with CRPS and coverage.
  • Hyperparameter tuning with grid, random and Bayesian search (Optuna), including the number of lags.
  • Feature engineering: rolling statistics, calendar features, exogenous and categorical variables, and differentiation.
  • Global models that forecast many series with one model, even with different lengths, exogenous variables and missing values.
  • Explainability and monitoring: feature importances and SHAP values, feature selection and drift detection.

Forecasters

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

Documentation

The full documentation is available at https://skforecast.org.

Documentation
📖 Introduction to forecasting Forecasting concepts and how to choose a forecaster
🚀 Quick start Install skforecast and train your first model
🛠️ User guides Detailed guides on every feature
🎓 Examples and tutorials Practical examples, in English, Spanish and Chinese
❓ FAQ and tips Answers and tips about forecasting
📚 API Reference Reference for all functions and classes
📝 Releases What changed in each version

AI and tools

Skforecast AI PyPI GitHub MCP server Skforecast Studio llms.txt Claude Code plugin

  • AI-assisted coding: skforecast publishes machine-readable context files so AI assistants (ChatGPT, Claude, Copilot and others) generate accurate code. Paste 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.
  • skforecast-ai: an AI forecasting assistant that pairs a deterministic engine, powered by skforecast, with an LLM reasoning layer. Install it with 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.
  • Skforecast Studio: a no-code application to build forecasting models visually, which generates production-ready Python code.

Contributing

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).

skforecast contributors

Citation

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.

Sponsorship and funding

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.

Support skforecast on Open Collective  Buy Me a Coffee  Sponsor skforecast on GitHub

License

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.

Metadata

Release files for skforecast 0.27.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skforecast 0.27.0
File Size Uploaded Provenance Actions
skforecast-0.27.0.tar.gz 609.9 kB With provenance Details for skforecast-0.27.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skforecast 0.27.0
File Interpreter ABI Platform Actions
skforecast-0.27.0-py3-none-any.whl Python 3 none any Details for skforecast-0.27.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / skforecast-0.27.0.tar.gz

Download URL skforecast-0.27.0.tar.gz
Size 609.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a755c4a6b8b5dba27f22f5d281a65f6016ab29af65f861bed4bbe439a6d3a0dc
BLAKE2b-256 checksum
How to use checksums
d7047c02204544aceed20d9b0785b86940e9d76834ac7bac4a9acef2e883ed47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / skforecast-0.27.0-py3-none-any.whl

Download URL skforecast-0.27.0-py3-none-any.whl
Size 638.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20d15944172610e36cc42d405122db82657f4d57457e4b203227ca1c4781272e
BLAKE2b-256 checksum
How to use checksums
045da6b104cc8662e4186ec482d15470fc54f58d20abc5df216f0691f1f10e92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for skforecast 0.27.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for skforecast-0.27.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.27.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page