I compared XGBoost, LightGBM, CatBoost, random forest, LASSO, and a small neural network in a momentum stock trading strategy
Last week I posted about an XGBoost based momentum stock trading strategy, and I got two separate comments:
“Why not LightGBM?”
“Why not CatBoost?”
So I did a controlled swap of 6 models inside my existing momentum pipeline and reran the same backtest with:
- XGBoost
- LightGBM
- CatBoost
- Random Forest
- LASSO
- A simple 2‑layer neural net (sklearn’s MLPRegressor)
Setup / constraints
- Same universe, features, filters, and portfolio construction
- Only the model changes; all other code is identical
- Default hyperparameters for each model (on purpose) to see how they behave “out of the box”
- Logged everything to MLflow so I could compare runs, metrics, and charts cleanly
I’m not claiming this is a definitive “which model is best” answer, just one controlled experiment on one dataset/strategy. But a few patterns showed up that I thought were interesting.
High‑level takeaways:
- XGBoost and LightGBM were basically neck‑and‑neck on headline returns, but XGBoost had a better risk profile. CatBoost underperformed in a way that I wasn’t expecting.
- The NN had the highest CAGR, Sortino, and total return. This was another surprise to me. But XGBoost and LightGBM had better drawdowns.
- LASSO and random forest did not beat the S&P in the cumulative returns over the time period, all the other algos beat the S&P.
The goal here was to largely show that it's easy to switch out algorithms and how different algorithm families perform. Disclaimer: the full article does contain links, but this was truly an analysis that took a long time that I wanted to share with the community. Full article with more results: https://www.datamovesme.com/blog/what-happens-when-you-swap-out-xgboost-a-6model-momentum-showdown
[link] [comments]
Want to read more?
Check out the full article on the original site