Skip to main content
Run StatsForecast distributedly on top of Spark.
StatsForecast works on top of Spark, Dask, and Ray through Fugue. StatsForecast will read the input DataFrame and use the corresponding engine. For example, if the input is a Spark DataFrame, StatsForecast will use the existing Spark session to run the forecast. A benchmark (with older syntax) can be found here where we forecasted one million timeseries in under 15 minutes.

Installation

As long as Spark is installed and configured, StatsForecast will be able to use it. If executing on a distributed Spark cluster, make use the statsforecast library is installed across all the workers.

StatsForecast on Pandas

Before running on Spark, it’s recommended to test on a smaller Pandas dataset to make sure everything is working. This example also helps show the small differences when using Spark.
unique_iddsAutoETS
002000-08-105.261609
102000-08-116.196357
202000-08-120.282309
302000-08-131.264195
402000-08-142.262453

Executing on Spark

To run the forecasts distributed on Spark, just pass in a Spark DataFrame instead.