Authors: Vivek Nagargoje, Hemant Chandegave, Samarth Kumbhar, Viraj Patil
Abstract: Predicting stock prices accurately is a complex challenge that must combine financial theory and applied machine learning. It involves issues like market non-stationarity, sensitivity to real-world events, and ways investor psychology impacts price movements. In this paper, we present Invest AI, a hybrid framework for prediction and analysis that combines three powerful models: XGBoost-based learning for processing structured features, stacked Long Short-Term Memory (LSTM) networks for capturing sequential patterns, and FinBERT-based sentiment analysis of financial news. Invest AI integrates these models’ outputs using a Loopy Belief Propagation-inspired weighting system that adjusts predictions based on the confidence of each model. The system was trained and tested on historical data sourced from the yfinance API. It has expanding window validation to prevent data leakage. Other than just making predictions, InvestAI includes SHAP-based explainability, anomaly detection, and financial performance backtesting through Sharpe ratio and maximum drawdown metrics. Over a year of out-of-sample data evaluation, this hybrid approach achieves a reduction in MAPE by 14.2% compared to other single-model performances. It also had a Sharpe ratio of 1.47 in simulated trading. This system combines temporal, relational, and sentiment-driven metrics to produce better results in financial forecasting.