Optimizing Indonesian Banking Stock Predictions with DBSCAN and LSTM - Purwandhani, Septiannisa Alya Shinta; Sajiatmoko, Aletta Agigia Novta; Aditya, Christian Sri Kusuma (Informatika, Universitas Jenderal Soedirman, 2025)
Investing in the stock market is challenged by high volatility, which often leads to inaccurate price predictions. Prediction models often struggle to handle the fluctuation phenomenon and produce unstable forecasts. This study aims to predict stock prices in three banks, namely PT Bank Central Asia Tbk (BBCA), PT Bank Rakyat Indonesia (Persero) Tbk (BBRI), and PT Bank Mandiri (Persero) Tbk (BMRI) using Long Short-Term Memory (LSTM) with the integration of Density-Based Spatial Clustering of Applications with Noise (DBSCAN) for anomaly detection. DBSCAN is applied with an epsilon (ε) of 0.5 and a minimum of 5 samples using Euclidean distance. The LSTM model consists of two hidden layers with 50 units, optimized using Adam, and applying the Mean Squared Error (MSE) loss function. The results show that DBSCAN improves prediction accuracy under several conditions. For BBCA stock, the lowest MSE was 0.003 at the 2nd fold with DBSCAN compared to 0.006 without DBSCAN. For BMRI stock achieved an MSE of 0.003 at the 4th fold with DBSCAN, while the 5th fold without DBSCAN obtained 0.000. For BBRI stock showed the best MSE of 0.003 at the 2nd fold with DBSCAN and the 5th fold without DBSCAN. These results show that the integration of DBSCAN can improve prediction especially when extreme price fluctuations occur. This research contributes to the development of stock price prediction methods that can be one of the benchmarks for investors before making decisions so that they do not experience losses.