Deep Learning and Machine Learning Models for Portfolio Optimization: Enhancing Return Prediction with Stock Clustering

Research output: Contribution to journalResearch articleContributedpeer-review

Contributors

Abstract

For stock market investors, precise stock forecasts lead to improved decisions and greater profits. This study focuses on advancing stock return predictions through a clustering approach applied to selected stocks. Deep learning (DL) and Machine Learning (ML) models are trained on representative data from each cluster to forecast stock returns within the clusters. We explore the combination of three clustering methods [Dynamic Time Warping (DTW), K-Means, and Density-Based Spatial Clustering of Applications with Noise (DBSCAN)] with four prediction models [Long Short-Term Memory (LSTM), Convolutional Neural Network (CNN), Random Forest (RF), and eXtreme Gradient Boosting (XGBoost)]. The effectiveness of each DL and ML model combined with clustering is tested using the Diebold-Mariano (DM) test, confirming their superiority over methods lacking clustering. We also introduce a two-step process for portfolio optimization using predicted returns. High-predicted return stocks are initially preselected, followed by applying the Mean-Variance with Forecasting (MVF) optimization model to allocate stocks optimally. Using data from the New York Stock Exchange's large-cap stocks (2013 to 2022), results demonstrate the superiority of each clustering-based prediction model combined with MVF. The findings are further validated through daily trading simulations on test data from 2017 to 2022.

Details

Original languageEnglish
Article number106263
JournalResults in Engineering
Volume27
Early online date12 Jul 2025
Publication statusPublished - Sept 2025
Peer-reviewedYes

External IDs

Scopus 105010680609

Keywords

ASJC Scopus subject areas

Keywords

  • Deep learning, Portfolio optimization, Mean-variance with forecasting, Return prediction, Clustering