## 4 Discussion
### Segregation of Industrial Pollutants Using a Machine Learning Clustering Algorithm  
Addressing the presence of phenols and chlorides in sewage requires technological innovation. This includes using advanced data analytics techniques, such as clustering algorithms to identify patterns and group similar samples [54]. Determining the optimal number of clusters remains a challenge in sewage composition analysis and this choice significantly impacts environmental management practices. This approach provides valuable insights into the complex interactions of different chemical compounds in sewage [55].  
In our study, using \(k\)-means clustering, two clusters were determined to be optimal across all studies. The clustering of the ether extract data (Figure 6a) resulted in less compact clusters (high value of Within-Cluster Sum of Squares of 12.564), with greater internal variance and weak separation (low \(F\)-statistic of 0.96961), explaining only a moderate portion (49.23%) of the data's variance. This suggests the initial clustering was ineffective at creating distinct groups and missed significant underlying structures. Therefore, raw treatment requires improvement, including exploring different clustering algorithms, varying cluster numbers, feature engineering and data re-evaluation for noise or outliers. Phenols (Figure 6b) are useful for assessing cluster cohesion because of their low WCSS value. WCSS of 0.0036858 indicated compact clusters with good internal cohesion and emphasised their effectiveness as an assessment parameter from a different perspective. The \(F\)-statistic of 1.3887 suggested some degree of separation between clusters, but also the possibility of overlap. The clustering explained a moderate portion (58.14%) of the data's variance. While the clusters showed internal consistency, the moderate Silhouette width and \(F\)-statistic suggested further investigation using different clustering methods, exploring alternative numbers of clusters and analysing specific phenols characteristics could lead to a more refined understanding of the structure of the data. For the average chlorides levels (Figure 6c), the Silhouette coefficient was 0.738, the highest among the analysed chemical compositions, highlighting chloride's effectiveness as a clustering indicator; chlorides are a strong clustering indicator. The Silhouette coefficient values for sulfates (Figure 6d) ranged from slightly below 0.0 to around 0.7. Positive values indicated well-clustered points, while negative values suggested some points might have been incorrectly assigned to a cluster or were near the cluster boundaries. Cluster 1 had higher Silhouette coefficient values compared to Cluster 2, indicating that Cluster 1 data points were more compact and well-separated from other clusters. The Silhouette coefficients for Cluster 1 neared 0.7, suggesting strong cohesion and separation.  
Another approach is the Silhouette score, which quantifies how similar an object is to its own cluster compared to other clusters. A higher Silhouette score indicates better-defined clusters. Selecting the optimal cluster number can provide valuable insights into the underlying structure of chemical compounds present in sewage samples. Clustering similar sewage samples helps identify distinct profiles, assess pollution and develop targeted treatments [56]. It can reveal pollutant correlations and highlight outliers. Choosing the right number of clusters is crucial for environmental research, management and policy, enabling better pollution control and water resource management [57]. Advancements in data analytics will further improve our understanding of sewage and its industrial pollutants for their environmental impact on water resource management [58; 59].