Transaction-Cost-Aware Random-Forest Portfolio Construction with Cardinality and Minimum-Weight Constraints

Jun Li1
1The school of Automation and Electrical Engineering, University of Science and Technology Beijing, Beijing, China
DOI: https://doi.org/10.71448/bcds2343-1
Published: 30/12/2023
Cite this article as: Jun Li. Transaction-Cost-Aware Random-Forest Portfolio Construction with Cardinality and Minimum-Weight Constraints. Bulletin of Computer and Data Sciences, Volume 4 Issue 3. Page: 1-9.

Abstract

Previous studies on random-forest–based portfolio construction show that fundamental variables can be organized into decision-tree leaves that behave like small, rule-based “micro-strategies,” and that combining the most profitable leaves can beat a broad market index. Yet these results usually assume highly idealized portfolios: they hold a large number of very small positions, ignore transaction costs, and allow full rebalancing every period. Such designs are hard to trade in real settings. This paper offers a practical variant. We keep the predictive core—a random forest trained on fundamental data—but change only the portfolio-formation layer to (i) cap the number of holdings through a cardinality constraint, (ii) enforce a minimum position size so that all weights are economically meaningful, and (iii) measure returns net of proportional transaction costs. Using S&P 500–like historical data, we find that these implementation-aware portfolios preserve most of the excess return delivered by the original unconstrained approach, while achieving materially lower turnover and a cleaner, more realistic weight distribution. This indicates that tree-based stock selection can be adapted to real-world trading frictions with only modest performance sacrifice.

Keywords: random-forest portfolio construction, fundamental data investing, cardinality-constrained portfolios, transaction-cost-aware weighting, tree-based stock selection

Abstract

Previous studies on random-forest–based portfolio construction show that fundamental variables can be organized into decision-tree leaves that behave like small, rule-based “micro-strategies,” and that combining the most profitable leaves can beat a broad market index. Yet these results usually assume highly idealized portfolios: they hold a large number of very small positions, ignore transaction costs, and allow full rebalancing every period. Such designs are hard to trade in real settings. This paper offers a practical variant. We keep the predictive core—a random forest trained on fundamental data—but change only the portfolio-formation layer to (i) cap the number of holdings through a cardinality constraint, (ii) enforce a minimum position size so that all weights are economically meaningful, and (iii) measure returns net of proportional transaction costs. Using S&P 500–like historical data, we find that these implementation-aware portfolios preserve most of the excess return delivered by the original unconstrained approach, while achieving materially lower turnover and a cleaner, more realistic weight distribution. This indicates that tree-based stock selection can be adapted to real-world trading frictions with only modest performance sacrifice.

Keywords: random-forest portfolio construction, fundamental data investing, cardinality-constrained portfolios, transaction-cost-aware weighting, tree-based stock selection
Jun Li
The school of Automation and Electrical Engineering, University of Science and Technology Beijing, Beijing, China

DOI

Cite this article as:

Jun Li. Transaction-Cost-Aware Random-Forest Portfolio Construction with Cardinality and Minimum-Weight Constraints. Bulletin of Computer and Data Sciences, Volume 4 Issue 3. Page: 1-9.

Publication history

Copyright © 2023 Jun Li. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Browse Advance Search