Practical overview
When it fits
Use Mlforecast when you want a Python-based forecasting workflow built around machine-learning regressors, especially when feature engineering, multi-series evaluation, prediction intervals, or cluster-based training are part of the task.
Who it is for
- Python developers building forecasting workflows for one or multiple time series.
- Teams evaluating models, adding prediction intervals, or scaling training through remote clusters.
Documented uses
- Train compatible machine-learning regressors across time series.
- Create lag, date, and transformed-target features for forecasting.
- Evaluate and select models with cross-validation.
- Generate probabilistic forecasts with conformal prediction.
- Train at scale using a Dask, Ray, or Spark cluster.
Requirements & limits
The repository specifies the Apache-2.0 license and documents installation through PyPI or conda-forge.
- Input series are documented in long format, with a series identifier, timestamp, and target value.
- Models must provide fit and predict methods compatible with the scikit-learn API.
- The documented integrations include pandas, Polars, Spark, Dask, and Ray.
- Distributed training uses a remote cluster option such as Dask, Ray, or Spark.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install mlforecast from PyPI or conda-forge
Install the released mlforecast package using one of its documented package sources.
Before you start
- A terminal with pip or conda available.
Steps
For PyPI, run the command below.
pip install mlforecastAlternatively, install from conda-forge with
conda install -c conda-forge mlforecast.For distributed training, choose Dask, Ray, or Spark and install the corresponding extra: the command below, the command below, or the command below.
pip install "mlforecast[dask]"pip install "mlforecast[ray]"pip install "mlforecast[spark]"
Expected outcome
The selected mlforecast package installation command is run; distributed-training extras are available as documented options.
Guide limitations
- The conda-forge package may become available about a day after a PyPI release.
- The installation instructions do not establish that installation succeeded in a particular environment.
Prepare long-format time-series data for mlforecast
Create or structure time-series data in the documented pandas long format.
Before you start
- Python environment with mlforecast and pandas available.
Steps
Represent each observation as a row in a pandas dataframe, with a series identifier and timestamp.
Use
unique_idto identify each distinct series; for one series, set it to a constant value.To create sample data, import
generate_daily_seriesfrommlforecast.utilsand call it with the documented parameters:n_series=20,max_length=100,n_static_features=1,static_as_categorical=False, andwith_trend=True.Inspect the result with
series.head().
Expected outcome
A pandas dataframe in long format is prepared or generated, with identifiers distinguishing the series.
Guide limitations
- This covers data preparation only; it does not document model training or producing forecasts.
- The example uses generated daily data and does not describe adapting data from a particular business source.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- Nixtla/mlforecast · Official homepage title · retained in its source language

