Skip to main content
An Interpretable Machine Learning Framework for River Water Hardness Classification

An Interpretable Machine Learning Framework for River Water Hardness Classification

This is a Preprint and has not been peer reviewed. This is version 1 of this Preprint.

Add a Comment

You must log in to post a comment.


Comments

There are no comments or no comments have been made public for this article.

Downloads

Download Preprint

Authors

Aditya Rajiv Ratnam 

Abstract

Determining water hardness in the field currently relies on laboratory Ethylenediaminetetraacetic acid (EDTA) titration or single-proxy electrical conductivity (EC) measurements, both of which have significant limitations. This study investigates whether routine in situ physicochemical parameters can accurately classify river water hardness without laboratory analysis. Using samples from a river basin in Argentina, four ML classifiers were evaluated against a trivial majority-class classifier (71.4% accuracy) and an EC threshold baseline (75% accuracy). A Random Forest model achieved 95.45% accuracy, a 20.45 percentage point improvement over the EC baseline. Five complementary feature importance and model interpretability approaches (Gini importance, permutation importance, SHapley Additive exPlanations (SHAP), feature ablation, and correlation analysis) show that the model captures physicochemical relationships pertaining to ionic interference, hydrological dilution, and temperature-dependent variations in conductivity. A minimal three-sensor suite comprising EC, Total Suspended Solids (TSS), and sample temperature matched full-model performance, demonstrating that accurate hardness classification is feasible with a low-cost, reagent-free field system. These findings support a practical pathway toward simpler and more sustainable water quality monitoring, in alignment with green chemistry principles of waste prevention and reduced chemical use.

DOI

https://doi.org/10.32942/X2HQ28

Subjects

Environmental Monitoring, Hydrology, Sustainability

Keywords

water hardness classification, machine learning, random forest, EDTA titration, water quality monitoring, physicochemical parameters, feature selection, sensor reduction, green chemistry, electrical conductivity

Dates

Published: 2026-08-03 09:48

Last Updated: 2026-08-03 09:48

License

CC BY Attribution 4.0 International

Additional Metadata

Data and Code Availability Statement:
https://github.com/adityaratnam09/waterhardnessML

Language:
English

Metrics

Views: 23

Downloads: 1