Non-optically active water quality parameters (NAWQPs) are essential for surface water quality assessments, although automated monitoring methods are time-consuming, include labor-intensive chemical pretreatment, and pose challenges for high spatiotemporal resolution monitoring. Advancements in spectroscopic techniques and machine learning may address these issues. We integrated ultraviolet-visible-near infrared absorption spectroscopy with physical-chemical measurements to predict total nitrogen (TN), dissolved oxygen (DO), and total phosphorus (TP) in the Yangtze River Basin, China. By combining the eXtreme Gradient Boosting algorithm with OPTUNA hyperparameter optimization and the SHapley Additive exPlanations interpretability framework, we developed an algorithm that yielded Nash-Sutcliffe efficiency values of 0.944, 0.934, and 0.835, and mean absolute percentage errors of 7.8 %, 8.2 %, and 7.7 % for TN, DO, and TP, respectively. The UV spectrum was significant in the NAWQPs prediction tasks. Our study offers a novel approach to water quality monitoring and resource management in complex aquatic environments.