đ[DS Code Review] Prophet vs. MLForecast
The showdown between the popular all-knowing packages
After this prior post about ARIMA and XGBoost gained some traction, on Reddit, some obvious questions popped up: why use XGBoost when you could use Prophet?
The great people of Reddit recommended the following packages:
prophet: Facebookâs brilliant time series forecasting tool.
Cool package I found to help with multivariate prediction: multi-prophet
mlforecast: does forecasting with XGBoost, LightGBM, and other packages.
Why use ARIMA and XGBoost when you can use these? Well, thatâs a good question. You tell me, experts.
Iâm a noob, ofc. But let me give my noob opinion on the matter.
Both MLforecast and Prophet are time series forecasting frameworks that can be used to make predictions for future time points. However, there are some differences between these two frameworks, and the choice between them may depend on your specific use case and data characteristics.
One key difference between the two frameworks is their underlying algorithms. MLforecast is a machine learning-based approach that uses a variety of algorithms, including gradient boosting and deep learning, to forecast time series data. Prophet, on the other hand, is a statistical model that uses a decomposable time series model with three main components: trend, seasonality, and holidays.
Another difference is their ease of use. Prophet is generally considered to be more user-friendly and easier to set up, requiring minimal data preprocessing and tuning of hyperparameters. MLforecast, on the other hand, may require more effort in terms of feature engineering and tuning of model hyperparameters.
When it comes to the type of time series data they can handle, both frameworks are designed to handle a variety of time series data, but there may be some differences in the types of time series data they are best suited for. MLforecast may be more suitable for time series with complex patterns and high dimensionality, while Prophet may be better suited for time series with strong seasonality and stable trends.
In terms of performance, both frameworks have been shown to be effective in forecasting time series data. However, the relative performance may depend on the specific use case and data characteristics.
In summary, the choice between MLforecast and Prophet may depend on the specific use case and data characteristics. If the data has complex patterns and high dimensionality, MLforecast may be more suitable. On the other hand, if the data has strong seasonality and stable trends and ease of use is important, then Prophet may be a better choice.
Getting to the Gritty
Hereâs my 2c when looking at what I can find from a few Google searches. Itâs important to remember that time series prediction requires you to forecast your regressors in order to make predictions. E.g., if you want to forecast revenue based on instagram posts and facebook posts, then you have to forecast how many posts youâre going to have in the future.
Well, you can easily know this because you can control how many times you post to your social platforms. But, what if youâre trying to predict revenue based on inflation? Youâd need to have some future value of âinflationâ to feed into your modelâs future prediction.
This is what prophet and MLForecast excel at compared to out-of-the-box XGBoost because theyâll create those features for you.
Prophet
Can prophet handle multiple regressors?
Initially, I didnât think prophet could handle extra regressors. Thatâs wrong. Hereâs prophetâs documentation on how to actually do that. And hereâs a blog post that shows you even more how do to this. (E.g., adding âweather tempâ and âweather conditionsâ to a time series prediction of bike share demand).
TLDR: itâs trickier than with
Can you use explainability techniques like Shapley values with prophet? Yes. Hereâs a person using the DALEX package to do that.
MLForecast
From reading the docs Iâm not sure about the following:
Can MLForecast do hyperparameter tuning? It doesnât seem to do hyperparameter tuning for you, but Iâm not sure. It certainly does time-series cross validation.
Takeaways
If you use prophet, you can have it âlearnâ the seasonal trend. If you use XGBoost or MLForecast, you need to âforceâ in the seasonal trend by dumping in a buttload of lags and figuring out which ones have high feature importance.
Why not combine them?
Drop your comments below and correct the many errors this post probably has.