A two-stage forecasting model using random forest subset-based feature selection and BiGRU with attention mechanism: Application to stock indices

S Shafiqah Azman D Dharini Pathmanathan V Vimala Balakrishnan

Abstract

The heteroscedastic and volatile characteristics of stock price data have attracted the interest of researchers from various disciplines, particularly in the realm of price forecasting. The stock market’s non-stationary and volatile nature, driven by complex interrelationships among financial assets, economic developments, and market participants, poses significant challenges for accurate forecasting. This research aims to develop a robust forecasting model to improve the accuracy and reliability of stock price predictions using machine learning. A two-stage forecasting model is introduced. First, a random forest subset-based (RFS) feature selection with repeated k-fold cross-validation selects the best subset of features from eight predictors: highest price, lowest price, closing price, volume, change, price change ratio, and amplitude. These features are then used as input in a bidirectional gated recurrent unit with an attention mechanism (BiGRU-AM) model to forecast daily opening prices of ten stock indices. The proposed model exhibits superior forecasting performance across ten stock indices when compared to twelve benchmarks, evaluated using root mean squared error (RMSE), mean absolute error (MAE), and the coefficient of determination, R2. The improved prediction accuracy enables financial professionals to make more reliable investment decisions, reducing risks and increasing profits.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 20, Issue 5
Published May 09, 2025
Pages e0323015
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (3)

S

Shafiqah Azman

D

Dharini Pathmanathan

V

Vimala Balakrishnan