Machine Learning Classification and Portfolio Allocation: with Implications from Machine Uncertainty

Yang Bai, Kuntara PukthuanthongarXiv 2021 · DOI

Abstract

This research utilizes multi-class machine learning classifiers to identify stocks likely to outperform or underperform the market. By shifting the focus from traditional regression to classification, the resulting long-short portfolios achieve significant annual Sharpe ratios of 1.67 (value-weighted) and 3.35 (equal-weighted), with annual alphas ranging from 29% to 48%. These results remain robust among large-cap stocks and persist after controlling for machine learning regressions. A key contribution of this study is the introduction of "Machine Uncertainty," measured via predicted probabilities. Stocks characterized by high machine uncertainty experience lower returns, particularly when machine uncertainty aligns with human proxies of information uncertainty. This effect is primarily driven by past underperformers, suggesting that information frictions play a critical role in market pricing.

Introduction

In quantitative finance, the prevailing application of machine learning (ML) has been regression—attempting to predict the exact numerical return of a security. However, stock returns are notoriously noisy, making precise point estimates difficult to achieve and often unreliable for portfolio construction. This paper proposes a methodological shift: treating return prediction as a multi-class classification problem. By categorizing stocks into performance buckets rather than predicting exact percentages, models can better capture non-linearities and economic signals that traditional mean-squared error (MSE) minimizing regressions might overlook.

Methodology: Classification and Entropy

The researchers employ three primary machine learning architectures: Artificial Neural Networks (ANN), Random Forests (RF), and Gradient Boosting Trees (GBT). These models are tasked with sorting stocks into three categories: "Outperformers," "Mid-performers," and "Underperformers."

The Innovation of Machine Uncertainty

The study’s most significant conceptual contribution is the formalization of "Machine Uncertainty" using Shannon Entropy. In a classification context, models output a probability distribution across the three classes. If a model assigns a 90% probability to a single class, its entropy is low, signaling high confidence. Conversely, if the probabilities are evenly split (e.g., 33% each), the entropy is high, signaling that the machine is "uncertain" due to information scarcity or conflicting signals in the data.

By quantifying this uncertainty, the authors test whether the machine’s subjective confidence serves as a reliable indicator of future market outcomes.

Data and Empirical Design

The study utilizes a comprehensive dataset centered on the Center for Research in Security Prices (CRSP) data:

  • Timeline: Monthly observations from January 1962 to December 2021.
  • Scope: Over 3.29 million observations across 24,136 distinct stocks.
  • Features: 102 firm-specific characteristics, including size, momentum, value, and volatility, alongside 2-digit SIC industry indicators.
  • Validation: An out-of-sample testing period from 1983 to 2021, with models retrained every ten years to mitigate look-ahead bias.

Key Findings

1. Superior Risk-Adjusted Returns

The classification-based portfolios demonstrate extraordinary economic performance. The aggregate long-short portfolio generated an annual Sharpe ratio of 1.67 on a value-weighted basis and 3.35 on an equal-weighted basis. Annual alphas ranged between 29% and 48%, and these returns could not be explained by standard risk models such as the CAPM or the Fama-French 5-factor model.

2. The Predictive Power of Uncertainty

Machine uncertainty is not merely a diagnostic metric; it is a potent predictor of returns. The study finds that a one-bit increase in machine uncertainty is associated with a 9% reduction in prediction accuracy and a 1.2% decrease in annual returns. High machine uncertainty is consistently linked to lower future returns, suggesting that when the model is "confused," the asset is more likely to underperform.

3. Synergy with Human Proxies

The impact of machine uncertainty is most pronounced when it aligns with human proxies of information uncertainty, such as high analyst forecast dispersion or wide bid-ask spreads. This alignment suggests that machine learning models are successfully capturing the same underlying information frictions that challenge human analysts.

4. Information Frictions and Underperformance

The negative relationship between uncertainty and returns is primarily driven by stocks that have previously underperformed. This aligns with the "bad news travels slowly" hypothesis: in environments with high information uncertainty, negative information is incorporated into prices more slowly, leading to sustained underperformance for these securities.

Conclusion

This research demonstrates that classification-based ML models offer a robust alternative to traditional regression in finance. By focusing on performance categories and explicitly measuring model uncertainty, investors can construct portfolios that yield significant alphas even among large-cap stocks. The findings suggest that "what the machine does not know" is a critical economic signal, highlighting the importance of information transparency in market efficiency.

Summary updated

Abstract

We use multi-class machine learning classifiers to identify the stocks that outperform or underperform other stocks. The resulting long-short portfolios achieve annual Sharpe ratios of 1.67 (value-weighted) and 3.35 (equal-weighted), with annual alphas ranging from 29\% to 48\%. These results persist after controlling for machine learning regressions and remain robust among large-cap stocks. Machine uncertainty, as measured by predicted probabilities, impairs the prediction performance. Stocks with higher machine uncertainty experience lower returns, particularly when human proxies of information uncertainty align with machine uncertainty. Consistent with the literature, such an effect is driven by the past underperformers.
BibTeX
@misc{bai2021machine,
  author = {Yang Bai and Kuntara Pukthuanthong},
  title = {{Machine Learning Classification and Portfolio Allocation: with Implications from Machine Uncertainty}},
  year = {2021},
  eprint = {2108.02283},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.02283},
}
Figure