Stock Prediction Using LSTM and Linear Regression with Anomaly Detection and Sentiment Analysis - Agrawal, Aman; Mathur, Saakshi (International Journal of Computer Sciences and Engineering, 2025)
This research introduces a hybrid framework for stock market prediction that combines Long Short-Term Memory (LSTM) networks, linear regression, sentiment analysis, and anomaly detection into a single system. Historical OHLCV data is used to train the LSTM model to capture complex temporal trends, while a linear regression layer smooths the output to reduce sensitivity to short-term noise. To enrich numerical features, sentiment scores are extracted from daily financial news headlines using TextBlob, enabling the model to account for psychological and event-driven market behavior. An anomaly detection module calculates the standard deviation of daily returns and annualizes it using ?252 to identify volatility spikes that may signal market instability. The integrated system achieves a high prediction accuracy of 96.2%, outperforming several existing models in both short- and long-term forecasts. Beyond prediction, the system provides actionable investment recommendations. It evaluates predicted returns and volatility across stocks, then optimizes fund allocation based on a user`s budget to maximize expected gains while minimizing risk. Extensive back-testing demonstrates the model’s robustness, adaptability, and practical value. Deployed as a web-based tool, this comprehensive solution empowers investors and researchers with a multidimensional, data-driven approach to navigate the complexity and volatility of financial markets effectively.