Recommender systems are crucial for filtering vast amounts of digital content and providing personalized recommendations; however, their effectiveness is often hindered by data sparsity, where limited user-item interactions lead to reduced prediction accuracy. This study introduces a novel hybrid model, Optimization Hybrid Weighted Switching Filtering (OHWSF), to overcome this challenge by integrating two complementary strategies: Hybrid Weighted Filtering (HWF), which linearly combines predictions from SVD and SVD++ using a weighting parameter (α), and Hybrid Switching Filtering (HSF), which dynamically selects predictions based on a threshold rating (θ). The OHWSF framework introduces a tunable optimization mechanism governed by the parameter σ₁ to adaptively balance weighting and switching decisions based on actual rating deviations. Unlike existing static or manually tuned hybrid methods, the proposed model combines dynamic switching with weight optimization to minimize prediction error effectively. Extensive experiments on four benchmark datasets (ML-100K, ML-1M, Amazon Cell Phones Reviews, and GoodBooks-10K) demonstrate that OHWSF consistently outperforms traditional collaborative filtering (UBCF, IBCF), matrix factorization techniques (SVD, SVD++), and standalone hybrid models across all evaluation metrics (MAE, MSE, RMSE). The model achieves optimal performance within the range of α = 0.6–0.9 and θ = 1.0–1.5, demonstrating robustness across varying sparsity levels. Notably, OHWSF achieves up to 742.16% MAE improvement over the UBCF model, with significantly reduced training time compared to SVD++. These findings confirm that OHWSF significantly improves prediction accuracy, scalability, and adaptability in sparse data environments. This research contributes a flexible, interpretable, and efficient hybrid recommendation framework suitable for real-world applications.