Predicting Stock Market Returns Using Temporal Fusion Transformer: A Comprehensive Data-Driven Approach

نویسندگان

1 Department of Computer Science, University of Passau, Passau, Germany

2 School of Industrial Engineering and Management, Shahrood University of Technology, Shahrood, Iran

3 Department of Computer Engineering, Imam Reza International University, Mashhad, Iran.

doi
10.22067/ijaaf.2026.47513.1562
چکیده

Stock market return prediction remains a highly challenging task due to the complex, dynamic, and noisy nature of financial markets. Although machine learning and deep learning models have been widely explored, many approaches struggle to capture long-term temporal dependencies and provide interpretable feature selection. In tackling these issues, the Temporal Fusion Transformer (TFT) is applied for multi-horizon time series forecasting of daily returns in Tehran Stock Exchange (TSE). Accordingly, the study proposes a new feature selection method called Initial Selected Features–Mutual Information Difference (ISF-MID), which enhances the traditional Minimum Redundancy Maximum Relevance (mRMR) algorithm by demonstrating a superior capability of handling redundancy and focusing on determining important parameters. Dual preprocessing works on ISF-MID, mRMR and PCA that improve the predictive performance, while also allowing for interpretable machine learning by working with a better representation of input. Mean Absolute Error (MAE), Mean Squared Error (MSE) and the coefficient of determination (R²) were used to conduct extensive comparisons with benchmark methods such as, Long Short-Term Memory LSTM, Multi-Layer Perceptron MLP, and Random Forest RF. Thus, the proposed method achieved competitive performance against benchmark architectures (i.e. TFT achieves R², of 98.9%, MAE 0.00043 and MSE 0.000018 on out-of-sample test, as well as high directional accuracy). Overall, the synergy of TFT with the ISF-MID feature selection strategy provides methodological novelty and practical significance, extending a potential framework for evidence-based return prediction and informed risk-central investment decisions.