Prediction and anomaly detection in water quality with explainable hierarchical learning through parameter sharing