Linking drinking water quality to customer complaints: a data-driven study in the barcelona metropolitan area
摘要
This study addresses the challenge faced by urban water utilities in translating technical water quality parameters into actionable insights on customer perception, using a data science approach in the Barcelona Metropolitan Area. Ten years of customer complaint data (2013–2023) from the water utility, Aigües de Barcelona, were integrated with corresponding water quality measurements. A comprehensive data pipeline prioritised high-coverage parameters for predictive analysis, including residual chlorine, conductivity, pH, and temperature. Exploratory Data Analysis revealed strong correlations among mineral-related parameters and identified residual chlorine and turbidity as the most distinctive variables in complaint-associated cases. Predictive modelling with Random Forest and XGBoost achieved consistent discrimination (AUC–ROC = 0.75 on a temporally held-out test set). Threshold optimisation enabled a recall exceeding 0.90, aligning with the operational objective of early detection of potential customer dissatisfaction. Interpretability analyses using SHapley Additive exPlanations confirmed that residual chlorine and conductivity, in interaction with temperature and pH, were the most influential drivers of complaint probability, exhibiting non-linear effects. These patterns were translated into actionable thresholds for operational improvement through heatmaps and logistic regression on discretised quartiles. Overall, the data-driven machine learning approach successfully links technical water quality variables to consumer dissatisfaction, providing actionable insights for utility management.