Abstract
The prediction of stock market trends is a challenging yet critical task in the financial sector, given its significant implications for investors, traders, and financial institutions. This research leverages the Long Short-Term Memory (LSTM) algorithm, a type of recurrent neural network (RNN), to develop a robust model for forecasting stock prices. The study utilizes historical stock market data sourced from Yahoo Finance, accessed via the yfinance package in Python. The primary objectives are to preprocess the data, implement the LSTM model, and evaluate its performance against traditional models such as Random Forest and Linear Regression. Data preprocessing involved handling missing values, normalizing the dataset, and transforming it into sequences suitable for LSTM training. The model's architecture includes multiple LSTM layers designed to capture temporal dependencies in the data. The study evaluates the model's performance using metrics such as Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and prediction accuracy. Comparative analysis shows that the LSTM model outperforms both Random Forest and Linear Regression models, with lower MSE and RMSE values and higher accuracy in predicting stock prices. This research discovered that LSTM's ability to retain long-term dependencies makes it particularly effective for stock market prediction, where historical trends and patterns significantly influence future prices. The results indicate that the LSTM model provides more reliable and precise predictions, which can enhance decision-making in trading and investment. This research highlights the potential of advanced neural network architectures in financial forecasting, offering a valuable tool for investors aiming to optimize their strategies and mitigate risks. The significance of this study lies in its practical application in the financial industry, demonstrating that machine learning models, particularly LSTM, can substantially improve the accuracy of stock market predictions. Future research could explore the integration of additional features, such as macroeconomic indicators and sentiment analysis, to further enhance model performance. This study underscores the importance of continuous innovation and the adoption of sophisticated algorithms to navigate the complexities of financial markets.
Publisher
Lattice Science Publication (LSP)
Reference12 articles.
1. Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8), 1735-1780. https://doi.org/10.1162/neco.1997.9.8.1735
2. Brownlee, J. (2018). Deep Learning for Time Series Forecasting. Machine Learning Mastery.
3. Moody, J. (1992). The predictive value of the CRSP stock market total return index. Journal of Financial Economics, 31(1), 43-75.
4. Yahoo Finance API Documentation. (n.d.). Retrieved from https://pypi.org/project/yfinance/ .
5. Zhang, Y., & Jansen, B. J. (2009). Predicting the Stock Market. IEEE/WIC/ACM International Joint Conferences on Web Intelligence and Intelligent Agent Technology, 343-346.