Given the increased incidence of pluvial floods due to climate change and urbanization, the demand for highly efficient and accurate modeling within urban drainage systems has intensified, making machine learning and deep learning techniques increasingly popular. Nonetheless, these data-driven approaches face challenges in adequately capturing and interpreting dynamic process-evolving features, especially the spatiotemporal effects emanating from manholes during urban waterlogging events. To address these issues, this study proposes a general framework that extracts the spatiotemporal effects using the dynamic spatial Durbin model, integrates such effects with four machine learning models (i.e., artificial neural network, Bayesian neural network (BNN), light gradient boosting machine, and long short-term memory network), and clarifies decision-making processes of the best model by employing the Shapley Additive Explanations (SHAP) method. The results indicate that (1) the BNN with spatiotemporal effects (BNNST) not only outperforms other benchmark models but also provides accurate forecasts with quantifiable uncertainties; (2) compared to the original model, spatiotemporal effects enhance the models’ understanding of urban flooding dynamics, thereby improving predictive precision; (3) spatiotemporal effects comprise roughly 14 % of the contributions to the BNNST’s output, as interpreted by SHAP-based explanations; (4) incorporating interpretability into the BNN technique underscores the trustworthiness of the explanations at varying confidence levels, thereby deepening the understanding of decision-making processes.