mlforecast is a time-series forecasting framework built around machine-learning models, designed to make forecasting both efficient and scalable. It lets you apply any regressor that follows the typical scikit-learn API, for example, gradient-boosted trees or linear models, to time-series data by automating much of the messy feature engineering and data preparation. Instead of writing custom code to build lagged features, rolling statistics, and date-based predictors, mlforecast generates those automatically based on a simple configuration. It supports multi-series forecasting, meaning you can train one model that forecasts many time series at once (common in retail, demand forecasting, etc.), rather than one model per series. The library is built to scale: behind the scenes, it can leverage distributed computing frameworks (Spark, Dask, Ray) when datasets or the number of series grow large.
Features
- Automated generation of lag features, rolling/statistical transforms, date/time features and target transforms for time-series data
- Accepts any machine-learning model compatible with scikit-learn (.fit() / .predict()) — e.g., LightGBM, LinearRegression, RandomForest, etc.
- Handles multiple time series simultaneously (multi-series forecasting), not just single-series forecasting
- Support for exogenous variables and static covariates, enabling richer modeling when external data is available
- Compatibility with distributed data frameworks (pandas, polars, Spark, Dask, Ray) for scalable forecasting on large datasets
- Built-in time-series cross-validation, evaluation and prediction pipelines to streamline model training and validation