mlforecast
Scalable machine learning based time series forecasting
What it is and what it does
mlforecast is a time series forecasting framework that trains regressors on multiple series simultaneously. It automates feature engineering—lag creation, rolling statistics, date features—and handles the recursive prediction strategy needed to forecast multiple steps ahead. The core workflow is: load data in long format (one row per series-timestamp pair), define models and features, call fit() to train, then predict(n) to generate n-step forecasts.
The package is designed for production use and scales to large datasets through optional integration with Dask, Ray, or Spark clusters. It supports exogenous variables, static covariates, probabilistic forecasting via Conformal Prediction, and cross-validation for model evaluation. Dependencies include pandas for data handling, coreforecast for optimized feature computation, narwhals for dataframe abstraction, and optuna for hyperparameter optimization.
Use it for:
- Train models across multiple time series and generate multi-step forecasts with automatic lag feature updates.
- Optimize hyperparameters across multiple models using cross-validation splits cached during training.
- Forecast demand by combining lag features, rolling statistics, and exogenous variables.
- Distribute training across a Dask or Ray cluster to handle large numbers of time series.
- Generate prediction intervals using Conformal Prediction to quantify forecast uncertainty.
- Pretrain a model on one set of series and fine-tune on a different series with limited history.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
mlforecast trains machine learning models on time series data and generates forecasts, with built-in support for feature engineering, multiple models, and distributed training across remote clusters.
Yes. mlforecast is actively maintained, has no known vulnerabilities, and provides a production-ready framework for time series forecasting at scale. It combines efficient feature engineering with optional distributed training. Install if you need to forecast multiple time series with machine learning models; skip if you need deep learning or univariate statistical methods only.
Install
mlforecast on PyPI
pip
pip install mlforecastuv
uv add mlforecastpoetry
poetry add mlforecastInstalling mlforecast
Before you install
Low install friction; pure Python wheel with 8 runtime dependencies including pandas, coreforecast, and optuna. Active maintenance with a release 35 days ago and ongoing commits.
License in practice
Apache Software License 2.0 is permissive; you can use, modify, and distribute mlforecast freely in commercial and private projects provided you include the license notice.
Quickstart
pip install mlforecast
from mlforecast import MLForecast
import pandas as pd
fcst = MLForecast(
models=[model1, model2],
freq='D',
lags=[7, 14],
date_features=['dayofweek']
)
fcst.fit(series)
predictions = fcst.predict(14)
Requires Python 3.10 or later; input data must be a pandas DataFrame in long format with columns for unique_id, ds (timestamp), and y (target value).
Verify before relying
- Whether distributed training via Dask, Ray, or Spark requires additional cluster setup beyond the base install.
- Performance characteristics when forecasting millions of time series—the description claims efficiency but provides no benchmarks.
- Whether Conformal Prediction for prediction intervals requires additional dependencies or configuration.
Package facts
| License | Apache Software License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — cloudpickle, coreforecast, fsspec, narwhals, optuna, pandas, scikit-learn, utilsforecast |
| Maintenance | actively maintained — 35 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 494,140/month — #6,352 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mlforecast-1.1.0-py3-none-any.whl
Keywords: python, forecast, forecasting, machine-learning, dask
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
coreforecastProvides fast C++ implementations of…
permissive · top 5,000 on PyPI
neuralforecastNeuralForecast provides a collection of neural…
permissive · top 15,000 on PyPI
utilsforecastProvides utilities for time-series forecasting…
permissive · top 5,000 on PyPI
statsforecastStatsForecast provides fast implementations of…
permissive · top 5,000 on PyPI
neuralprophetNeuralProphet is a PyTorch-based framework for…
permissive · top 15,000 on PyPI
dask-mlDask-ML provides distributed and parallel…
permissive · top 15,000 on PyPI
hierarchicalforecastReconciles hierarchical time-series forecasts…
permissive · top 15,000 on PyPI
datasetsforecastDownloads and loads curated time-series…
permissive · top 15,000 on PyPI
skforecastSkforecast is a Python library for time series…
permissive · top 15,000 on PyPI
fevfev is a lightweight benchmarking library for…
permissive · top 15,000 on PyPI