AI Stock Prediction: LSTM-RF Hybrid Model
AI Stock Prediction: LSTM-RF Hybrid Model
Abstract: While many investors participate in stock markets with profit motives, most struggle due to insufficient
understanding of price behavior and analytical techniques. This study develops an enhanced prediction framework
combining LSTM-Random Forest algorithms to improve forecasting reliability. The integrated model processes both
sequential price patterns and key market indicators to generate more accurate predictions.
Evaluation results demonstrate that the combined LSTM-Random Forest approach achieves better performance than
individual models, with measurable improvements in prediction error reduction and trend explanation. The system
effectively balances temporal pattern recognition with robust feature analysis.
Future extensions of this work will focus on three directions: operational deployment for real-time analysis,
incorporation of qualitative market sentiment, and enhancement of sequential processing capabilities. This research
provides traders with an advanced analytical tool while emphasizing that market predictions should complement, rather
than replace, informed decision-making and risk awareness.
Keywords: Hybrid Forecasting, Sequential Pattern Recognition, Ensemble Market Analysis, Adaptive Technical Indicators,
Probabilistic Trading Insights.
How to Cite: Priyadharshini Sekaran; R. Dhamotharan. (2025). Next-Gen AI Stock Prediction: How LSTM+RF Hybrids
Outperform Traditional Models. International Journal of Innovative Science and Research Technology,
10(3), 2013-2022. https://doi.org/10.38124/ijisrt/25mar1247.
This dual-paradigm approach enables comprehensive market Rigorous empirical evaluation demonstrates that this
analysis that accounts for both time-dependent patterns and integrated methodology achieves superior performance
structural relationships. metrics compared to singular modeling approaches. The
hybrid framework not only reduces forecasting errors more
Comprehensive Market Feature Integration effectively but also provides enhanced interpretability of
Moving beyond conventional price history analysis, the market trends and turning points, offering financial analysts
system incorporates multiple dimensions of market and investment professionals a more reliable decision-
intelligence, including trend-smoothing operators, support tool.
momentum oscillation metrics, and convergence-divergence
measurements as fundamental model inputs (Patel & Li, IV. METHODOLOGY
2022). This multidimensional feature space provides a more
complete representation of market dynamics. The methodology covers four key aspects: dataset
preparation, model architecture, training process, and model
Adaptive Feature Space Optimization evaluation.
The framework implements continuous feature
importance evaluation through dynamic weighting A. Dataset Preparation
mechanisms. This automated process identifies and The analysis incorporates Apple's (AAPL) historical
prioritizes the most relevant market characteristics while market data, sourced from publicly available financial
simultaneously suppressing noise and redundant signals, records. It includes 11,109 data entries across seven key
enhancing model robustness. financial attributes, ensuring a comprehensive analysis of
stock price trends. To ensure high-quality input data and
Continuous Learning Architecture preventing inconsistencies the missing values are addressed
The system incorporates scheduled knowledge refresh using interpolation techniques. Numerical features are
cycles through periodic retraining protocols, ensuring normalized using MinMaxScaler, transforming the data into
sustained prediction accuracy amid evolving market a uniform scale and preventing large numerical discrepancies
conditions and structural breaks (Sekaran, 2023). This from affecting the model's performance. Furthermore, a 50-
adaptive capability represents a significant advancement over day lookback period is applied to create input sequences,
static modeling approaches. where each sample consists of the past 50 days' data. These
refinements boost the system's performance in future market
movements with greater accuracy.
After sorting data by date, we have to calculate the necessary technical indicators mentioned above. The formulas used are
mentioned below:
B. Model Architecture
The proposed framework employs a two-tiered
analytical approach designed to maximize predictive
accuracy. In the initial phase, a specialized sequential
processing architecture analyzes historical price movements
through multiple temporal analysis layers, each containing 50
computational units. These layers extract complex time-
dependent patterns before passing refined features to a 25-
unit neural transformation module, which synthesizes the
temporal relationships into preliminary forecasts. The system
employs adaptive gradient optimization with error-squared
minimization to iteratively refine its parameters, while an
80:20 data partitioning strategy ensures reliable
generalization by continuously validating performance
against unseen market conditions. This sophisticated
architecture deliberately separates pattern recognition from
prediction generation, allowing each component to specialize
in its respective function while maintaining overall
computational efficiency and interpretability.
Fig 12: Visualization of Actual Closing Price with LSTM+ XGBoost Predictions
Fig 13: Visualization of Actual Closing Price with LSTM + Random Forest Predictions
Empirical evidence in the accompanying tabulation establishes our unified framework's superiority to singular LSTM
implementations.
F. Key Findings: The next phase of this work will explore ways to
incorporate qualitative data—like public perception and
The comparative analysis illustrates that our hybrid model broader economic trends—into the analysis. This could help
achieves superior accuracy while maintaining stability refine predictions by accounting for shifts that numbers alone
during market fluctuations. Deep learning models like might miss. Still, anyone engaging with markets should first
LSTM capture long- term dependencies but may overfit build their understanding of how investments work. Our
due to their complexity. By combining LSTM with system is designed to assist decision-making, not replace it.
ensemble – based machine learning techniques, our model True success depends on combining smart tools with personal
effectively balances time – series forecasting capabilities judgment and awareness of ever-changing conditions
with robust feature learning, outperforming existing
approaches in terms of MSE and R squared score. ACKNOWLEDGMENT
Our findings align with previous studies demonstrating
that hybrid models mitigate overfitting and improve The author extends special gratitude to Professor Mr. R.
generalization, making them superior for financial Dhamotharan for his expert guidance throughout the project.
forecasting. The high accuracy of our proposed LSTM + The authors gratitude extends equally to Professor Mr.
Random Forest model further supports the need for Syedsafi. S discerning questions and constructive critiques
integrating deep learning with ensemble methods to fundamentally improved this investigation's methodology
predict stock market reliability. Hybrid models offer a and conclusions. Furthermore, the authors wish to
significant advantage over single models through acknowledge the contributions of various financial data
strategic integration of ensemble techniques with sources, research papers, and open – source tools that have
sequential neural architectures. While standalone models been instrumental in the development of this project. Special
like LSTM focus on capturing temporal dependencies, thanks are also due to peers and colleagues for their
integrating them with ensemble learning methods such as constructive discussions and encouragement, which have
Random Forest enhances robustness, reducing the risk of motivated us to refine our approach and achieve meaningful
overfitting and improving generalization across different outcomes. The author also sincerely thanks Mr. Venkatesh
market conditions. Sekaran for his patient explanations of stock market
fundamentals, which provided invaluable real-world context
VI. CONCLUSION AND FUTURE WORKS for this research.
[2]. Al-Khasawneh, Mahmoud Ahmad, Asif Raza, Saif Ur [14]. Peivandizadeh, A., Hatami, S., Nakhjavani, A.,
Rehman Khan, and Zia Khan. "Stock Market Trend Khoshsima, L., Qazani, M. R. C., Haleem, M., &
Prediction Using Deep Learning Alizadehsani, R. (2024). Stock market prediction with
Approach." Computational Economics (2024): 1-32.. transductive long short-term memory and social media
[3]. Sun, Yu, Sofianita Mutalib, Nasiroh Omar, and Liwei sentiment analysis. IEEE Access.
Tian. "A novel integrated approach for stock [15]. Du, Sha, and Hailong Shen. "A stock prediction
prediction based on modal decomposition technology method based on deep reinforcement learning and
and machine learning." IEEE Access (2024). sentiment analysis." Applied Sciences 14, no. 19
[4]. Yang, Cheng-Ying, et al. "Advancing Financial (2024): 8747.
Forecasts: Stock Price Prediction Based on Time [16]. Du, S., & Shen, H. (2024). A stock prediction method
Series and Machine Learning Techniques." Applied based on deep reinforcement learning and sentiment
Artificial Intelligence 38.1 (2024): 2429188. analysis. Applied Sciences, 14(19), 8747.
[5]. Christodoulaki, Eva, Michael Kampouridis, and Maria [17]. Agrawal, S., Kumar, N., Rathee, G., Kerrache, C. A.,
Kyropoulou. "A novel strongly-typed Genetic Calafate, C. T., & Bilal, M. (2024). Improving stock
Programming algorithm for combining sentiment and market prediction accuracy using sentiment and
technical analysis for algorithmic technical analysis. Electronic Commerce Research, 1-
trading." Knowledge-Based Systems (2025): 113054.. 24.
[6]. Nabipour, Mojtaba, Pooyan Nayyeri, Hamed Jabani,
Amir Mosavi, Ely Salwana, and Shahab S. "Deep
learning for stock market prediction." Entropy 22, no.
8 (2020): 840.
[7]. Shaban, W. M., Ashraf, E., & Slama, A. E. (2024).
SMP-DL: A novel stock market prediction deep
learning for effective trend forecasting. Neural
Computing and Applications, 36(4), 1849-1873.
[8]. Shaban, W. M., Ashraf, E., & Slama, A. E. (2024).
SMP-DL: A novel stock market prediction approach
based on deep learning for effective trend
forecasting. Neural Computing and Applications,
36(4), 1849-1873.
[9]. Purwantara, I. M. A., Setyanto, A., & Utami, E. (2024,
November). Deep Learning in Financial Markets: A
Systematic Literature Review of Methods and Future
Direction for Price Prediction. In 2024 6th
International Conference on Cybernetics and
Intelligent System (ICORIS) (pp. 01-06). IEEE.
[10]. Tashakkori, A., Erfanibehrouz, N., Mirshekari, S.,
Sodagartojgi, A., & Gupta, V. (2024). Enhancing
stock market prediction accuracy with recurrent deep
learning models: A case study on the CAC40
index. World Journal of Advanced Research and
Reviews, 23(1), 2309-2321.
[11]. Chowdhury, M. S., Nabi, N., Rana, M. N. U., Shaima,
M., Esa, H., Mitra, A., ... & Naznin, R. (2024). Deep
Learning Models for Stock Market Forecasting: A
Comprehensive Journal of Business and Management
Studies, 6(2), 95-99.
[12]. Sharma, R., & Mehta, K. (2024). Stock market
predictions using deep learning: developments and
future research directions. Deep Learning Tools for
Predicting Stock Market Movements, 89-121.
[13]. jun Gu, W., hao Zhong, Y., zun Li, S., song Wei, C.,
ting Dong, L., yue Wang, Z., & Yan, C. (2024,
August). Predicting stock prices with finbert-lstm:
Integrating news sentiment analysis. In Proceedings
of the 2024 8th International Conference on Cloud
and Big Data Computing (pp. 67-72).