A Machine Learning Framework for Stock Selection

XingYu Fu, JinHong Du, YiFeng Guo, MingWen Liu, Tao Dong, XiuWen DuanarXiv 2018

Introduction

In the volatile world of quantitative finance, the "holy grail" is a reliable way to separate the winners from the losers before the market does. This paper presents a robust pipeline that combines traditional statistical methods with modern deep learning and evolutionary algorithms to address the inherent noise and non-stationarity of financial data. By integrating a Genetic Algorithm (GA) for feature selection and a "Stacking" ensemble model, the researchers developed a system capable of achieving high predictive accuracy and consistent market outperformance.

The Challenges of Stock Selection

Stock selection serves as the foundation of any trading strategy; poor asset selection cannot be fully mitigated by portfolio management or timing. The authors identify four critical hurdles in building a reliable selection system:

  1. Labeling: Objectively defining a "good" stock in a noisy environment.
  2. Algorithm Choice: Selecting models that can handle financial noise without overfitting.
  3. Feature Engineering: Identifying predictive indicators among hundreds of potential technical and fundamental metrics.
  4. Evaluation: Proving practical utility through out-of-sample backtesting rather than just theoretical metrics.

Methodology

The researchers implemented a sophisticated four-step pipeline designed to filter noise and maximize predictive power.

Smart Labeling and Feature Selection

Instead of relying on raw returns, the framework ranks stocks by their return-to-volatility ratio (a metric similar to the Sharpe Ratio). To reduce noise, the top $Q$ percent are labeled as "good" and the bottom $Q$ percent as "bad," discarding the ambiguous middle.

Starting with 244 technical and fundamental features, the system employs a Genetic Algorithm (GA) to find the most predictive subset. This evolutionary approach successfully trimmed the feature set down to 114 indicators, suggesting that nearly half of common financial indicators are redundant or purely noisy in this context.

The multi-stage machine learning pipeline integrating GA-based feature selection and model training.

The Stacking Ensemble

The core innovation is the "Stacking" model, which combines diverse base models: Logistic Regression (LR), Random Forest (RF), and a three-layer Deep Neural Network (DNN). Because RFs and DNNs learn in fundamentally different ways, their errors are often uncorrelated. A meta-level Logistic Regression model then weighs these outputs to find a "sweet spot" between the aggressive identification of the DNN and the risk-neutral balance of the Random Forest.

Experimental Results

The framework was validated using data from the Chinese stock market. For initial statistical evaluation, data from August 2012 to March 2013 was utilized. The Stacking ensemble reached an impressive AUC score of 0.972, significantly outperforming the individual base models.

Backtesting Performance

To prove practical utility, the authors conducted "out-of-sample" backtests starting in late 2015, 2017, and 2018. In all tested periods, the portfolios constructed using the model's outputs consistently beat the market average.

Backtesting performance starting in late 2015, demonstrating the asset value growth of the proposed framework.

Even after the significant reduction in features via the GA, model performance remained stable, proving the robustness of the feature selection process. The results indicate that the ensemble approach effectively captures complex market patterns that single-model approaches might miss.

Discussion and Limitations

While the results are strong, the framework has limitations. The study focused exclusively on the Chinese stock market; its performance in more mature or different emerging markets remains to be seen. Additionally, Genetic Algorithms are computationally expensive, and the authors limited evolution to 100 iterations, which may not reach a global optimum in all scenarios. Finally, while the backtests show the portfolios "conquering the market average," further research is needed to detail how slippage or trading commissions might impact net returns in high-turnover environments.

The implementation is available on GitHub for further research and development.

Summary updated

BibTeX
@misc{fu2018machine,
  author = {XingYu Fu and JinHong Du and YiFeng Guo and MingWen Liu and Tao Dong and XiuWen Duan},
  title = {{A Machine Learning Framework for Stock Selection}},
  year = {2018},
  eprint = {1806.01743},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1806.01743},
}
Figure