
Figure 1
Location of the study area in Khyber Pakhtunkhwa, Pakistan.

Figure 2
Flowchart of the applied process for the water quality classification.
Table 1
Distribution of water quality index (WQI) categories.
| WQI RANGE | CATEGORIES |
|---|---|
| WQI < 50 | Excellent |
| 50–100 | Very good |
| 100–150 | Poor |
| 150–200 | Very poor |
| WQI > 200 | Unsuitable for drinking |

Figure 3
Decision tree visualization using the training set insight into model training.

Figure 4
Multiple layer perceptron for water quality classification.

Figure 5
Visualizing the distribution of water quality classes.
Table 2
Descriptive statistics of water quality index deviation from the WHO value (Ilaboya et al., 2014; Khwaja and Aslam, 2018).
| S.NO | PARAMETERS AND HEAVY METALS | UNIT | WHO VALUE | ASSIGNED WEIGHTS | RELATIVE WEIGHTS | MEAN | SD | RANGE |
|---|---|---|---|---|---|---|---|---|
| 1 | Cd | mg/L | 0.05 | 4 | 0.12 | 0.04 | 0.01 | (0.01–0.07) |
| 2 | Cr | mg/L | 0.03 | 4 | 0.12 | 0.05 | 0.04 | (0–0.18) |
| 3 | Pb | mg/L | 0.01 | 4 | 0.12 | 0.19 | 0.29 | (0.01–0.91) |
| 4 | Ni | mg/L | 0.07 | 3 | 0.09 | 0.05 | 0.02 | (0–0.17) |
| 5 | Fe | mg/L | 0.3 | 3 | 0.09 | 0.05 | 0.02 | (0.02–0.13) |
| 6 | As | mg/L | 0.01 | 5 | 0.15 | 0 | 0 | (0–0) |
| 7 | Ph | Number | 6.5–8.5 | 4 | 0.12 | 7.74 | 0.25 | (7.3–8.6) |
| 8 | Ec | µS/Cm | 400 | 2 | 0.06 | 107.14 | 74.1 | (20–309) |
| 9 | TDS | mg/L | 500 | 5 | 0.15 | 53.98 | 39.7 | (9.5–193) |
Table 3
Boruta algorithms based relative importance of water quality parameters and heavy metals.
| VARIABLE | MEAN-IMP | RANGE | NORM-HITS | DECISION |
|---|---|---|---|---|
| Cd | 12.89 | (11.51–13.84) | 1.00 | Confirmed |
| Cr | 15.79 | (13.77–17.46) | 1.00 | Confirmed |
| Pb | 24.74 | (22.14–27.06) | 1.00 | Confirmed |
| Ni | 10.13 | (8.96–11.65) | 1.00 | Confirmed |
| Fe | 11.03 | (9.51–12.05) | 1.00 | Confirmed |
| As | 1.02 | (–0.77–2.48) | 0.00 | Rejected |
| Ph | 3.59 | (1.53–4.99) | 0.76 | Confirmed |
| Ec | 13.27 | (12.01–14.92) | 1.00 | Confirmed |
| TDS | 15.14 | (13.34–16.51) | 1.00 | Confirmed |

Figure 6
Ranking important parameters provides insights from the random forest model.

Figure 7
Evaluating accuracy metrics across various supervised machine learning models.
