Skip to content
Projects

skforecast/skforecast has 1,546 GitHub stars and 207 forks. GitHot measured +1 stars in 24 hours and 0 in 7 days. Last checked 2026-11-09 03:32 UTC. Last push 2026-11-02.

How these counts are measured

Python library for time series forecasting using scikit-learn compatible models, statistical methods, and foundation models

Measured star growth

in 24h
+1
in 7 days
0
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

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.

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
: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

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

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.

Explore related projects