FA590 Statistical Learning · Stevens Institute of Technology · Fall 2025

Machine learning for stock returns

I manage my own investment portfolio, so I wanted to compare models in terms of both prediction error and the portfolios they produce. I tested five models on monthly stock returns from 2009–2021. LightGBM had the highest test R² and the highest portfolio Sharpe ratio in this comparison.

Information coefficient, test set

Spearman rank correlation, 2018–2021
Author
Zhenhan Chen
Data
890,592 monthly observations, 2009–2021 · 94 firm characteristics + 8 macro variables
Split
Train Jan 2009 – Dec 2017 · test Jan 2018 – Nov 2021, no shuffling
Models
OLS · Ridge · Lasso · LightGBM · MLP (32-16)
01

Accuracy versus ranking

R² measures return prediction error relative to a benchmark. IC measures how closely predicted and actual stock rankings agree.

Data table

The neural network had a training R² of 15.1% and a test R² of −21.3%. Adding regularization with Ridge or Lasso did little to improve OLS. The linear models still had positive rank correlations, even though their return prediction errors exceeded the mean-return benchmark.

02

Portfolio comparison

Each month: rank every stock by predicted return, buy the top 100 in equal weights, hold one month.

Annualized Sharpe ratio

top-100 equal-weight, test period, before costs

The report does not deduct trading costs. LightGBM's portfolio returned about 4.4% per month in this test, with monthly volatility of 12.4%. Lasso had a slightly higher average return, but LightGBM had the higher Sharpe ratio. These are backtest results rather than expected returns.

03

Feature importance

LightGBM split gain for the 20 most important of the 50 selected features. Market-wide variables are highlighted.

Macro variableFirm characteristic
macro_ep aggregate earnings-to-pricemacro_tms term spread macro_svar stock market variancemacro_dp aggregate dividend-to-price macro_dfy default yield spreadmacro_ntis net equity issuance mom12m / mom6m / mom1m past 12, 6 and 1-month returnbaspread bid-ask spread

The three highest-ranked features are macroeconomic variables. Momentum features also appear near the top. These rankings describe which variables the fitted model used; they do not establish a causal explanation for returns.

04

Limits

Preprocessing, sample period and trading costs.

LightGBM explains 1.45% of test-period return variance. The training period begins in 2009 and excludes the 2008 financial crisis. The report describes median imputation and correlation-based feature selection before its discussion of the time split; it does not establish that these steps used training data only. A stricter evaluation would fit all preprocessing within each training window, repeat the comparison over time and deduct trading costs.