Predicting the Stock Market Using Machine Learning

Authors

  • Partha Majumdar

Abstract

This research examines how different machine learning models perform in predicting stock market trends, particularly by converting stock market data into a stationary format. The main hypothesis posits that transforming stock market time series into a stationary state before utilising predictive models enhances forecasting accuracy. To evaluate this, historical data from the Indian stock market, along with pertinent macroeconomic indicators, was gathered and prepared to create both raw and stationary datasets. The study employed four deep learning models – Artificial Neural Networks (ANN), Recurrent Neural Networks (RNN), Long Short-Term Memory (LSTM), and Gated Recurrent Units (GRU) – on each dataset utilising a consistent sliding-window method.
The models were evaluated across multiple metrics, primarily R2 and Mean Squared Error (MSE), to assess their predictive performance over time. The results clearly indicate that stationarising the data enhances model stability and predictive accuracy. Across all architectures, models trained on stationary data consistently outperformed those trained on raw data. Among the four models, GRU demonstrated the strongest performance, especially in identifying intricate temporal relationships within stationary datasets. While the GRU model faced challenges with raw data, its performance greatly improved when the input was preprocessed for stationarity, exceeding that of ANN, RNN, and LSTM models in most instances.
The research indicated that traditional models like ANN struggled to identify trends in fluctuating financial data. In contrast, recurrent models such as RNN and LSTM showed some improvements. Yet, the GRU model, with its streamlined gating mechanisms and efficient memory usage, surpassed its counterparts, particularly when working with appropriately transformed input data. These results highlight the significance of data preparation and model choice in financial forecasting.
The study finds that GRU models using stationary data yield the highest accuracy and reliability among the evaluated options. It also identifies areas for future exploration, such as hybrid architectures like CNN-GRU, attention mechanisms, and transformer-based methods. The methodologies and insights shared in this research lay the groundwork for developing advanced predictive systems that can support investors, analysts, and researchers in tackling the challenges of financial markets.

Downloads

Published

2025-07-17

How to Cite

Majumdar, P. (2025). Predicting the Stock Market Using Machine Learning. Digital Repository of Theses - SSBM Geneva. Retrieved from https://repository.e-ssbm.com/index.php/rps/article/view/945