Skip to main content
AutoArima is faster and more accurate than FB-Prophet in most cases. Replace it with two lines of code.
We benchmarked on more than 100K series and show that you can improve MAPE and sMAPE forecast accuracy by 17% and 15% with 37x less computational time. Now you can replace Prophet with two lines of code and verify it for yourself.

Install StatsForecast

pip install statsforecast

Replace FB-Prophet to make your forecast a lot faster

We respected the original Prophet syntax so your pipeline won’t get affected.

Results on M3, M4, Tourism and Peyton Manning

Background

FB-Prophet is one of the world’s most used time series forecasting models. Its GitHub repository has more than 14 thousand stars, and more than a hundred repositories depend on it. However, in many scenarios, FB-Prophet does not offer good performance in terms of time and accuracy. This lacking performance suggests that the FB-Prophet’s success can be explained mainly by its usability. For example, adding exogenous and calendar variables is almost trivial. To contribute to the forecasting community, we created a FB-Prophet API adapter that lets you use Prophet’s useful methods without accuracy and computational downsides. Just import this AutoARIMAProphet adapter and replace the Prophet class to start using AutoARIMA in any of your existing pipelines.

Empirical validation

To validate the AutoARIMAProphet adapter, we designed a pipeline considering the M3, M4, and Tourism datasets (standard benchmarks in the forecasting practice) and the Peyton Manning data set originally used by FB. The pipeline automatically selects ARIMA’s parameters with the AIC criterion and selects Prophet’s parameters with time-series cross-validation.

Results

The following table shows the MAPE, sMAPE and Time (in minutes) AutoARIMA improvements on Prophet for each dataset.

Reproducibility

  1. Create a conda environment arima_prophet using the environment.yml file.
    conda env create -f environment.yml
    
  2. Activate the conda environment using
    conda activate arima_prophet
    
  3. Run the experiments for each dataset and each model using
    python -m src.experiment --dataset [dataset] --group [group] --model_name [model_name]
    
    For M4, the groups are Yearly, Monthly, Quarterly, Weekly, Daily, and Hourly. For M3, the groups are Yearly, Monthly, Quarterly, and Other. For Tourism, the groups are Yearly, Monthly, and Quarterly. Finally, for PeytonManning the group is Daily.
  4. Evaluate the results using
    python -m src.evaluation
    

Conclusion

  • Be mindful on what you read on Towards Data Science.
  • Always use strong baselines when forecasting.
  • Quick and easy results are sometimes misleading.
  • Simpler models are sometimes better.
  • Facebook’s Prophet might be many things, but it’s definitely not a model for forecasting time series at scale.

Misc.

  • StatsForecast also includes a variety of lightning fast baseline models.
  • If you really need to do forecast at scale, here we show how to forecast 1 million time series under 30 minutes using Ray.
  • If you are interested in SOTA Deep Learning models, check NeuralForecast.