# WaQuPs: A ROS-Integrated Ensemble Learning Model for Precise Water Quality Prediction
## 4 Materials and Methods  
### Dataset  
Our study leverages data from the Jakarta Open Data website [22] as our primary data source, comprising a comprehensive dataset with 267 entries. Each entry encompasses 16 critical physical and chemical parameters for water quality assessment, including metrics like TDS, turbidity, iron content, fluoride levels, and total hardness. It is crucial to note that this dataset is specifically tailored to the Jakarta, Indonesia area, as illustrated in Figure 1[23]. Accessible in csv format, the dataset is directly downloadable from the website. Importantly, our data collection strictly adheres to the pollution index method in accordance with Indonesian regulations, ensuring water quality compliance with established safety thresholds. These quality standards are outlined in the Regulation of the Minister of Health of the Republic of Indonesia No. 492/MENKES/PER/IV/2010, specifically addressing drinking water quality requirements [24]. A comprehensive breakdown of the parameters and their respective thresholds can be found in Table 1, providing a detailed reference for our analysis. Within this dataset, in addition to the previously discussed 16 parameters, a key variable is the pollution index value, which serves as a critical determinant for categorizing each water sample into specific classes. To assign the appropriate class to each sample, we adhere to the guidelines set forth in Government Regulation 82 of 2001, governing water quality management and water pollution control in Indonesia through the pollution index method [25]. This regulation introduces a structured water quality classification system comprising four distinct classes: 'Meeting Quality Standards', 'Lightly Polluted', 'Moderately Polluted', and 'Heavily Polluted'. Calculations to find the IP value are explained by  
Figure 1: Jakarta overview map. formula number 6 [25] and detailed specifications and guidelines for these classes can be found in Table 2, offering a comprehensive reference for our classification process. \[IPj=\sqrt{\frac{(\frac{Ci}{Lij})\frac{2}{M}+(\frac{Ci}{Lij})\frac{2}{R}}{2}} \tag{6}\]  
Within this context, the following variables are defined:  
* \(IPj=\) pollution index for designation \(j\)
* \(Ci=\) concentration of water quality parameters \(i\)
* \(Lij=\) concentration of water quality parameter \(i\) listed in water designation standard \(j\)
* \(M=\) maximum
* \(R=\) average  
Furthermore, our research entailed dataset preprocessing, a crucial step in the realm of data analysis that significantly impacts the overall data quality. Dataset preprocessing plays a pivotal role in enhancing data accuracy and ensuring the robustness of insights derived from the data. In essence, data preprocessing involves \"the aggregation and modification of data components to derive meaningful insights\" as defined succinctly by [PERSON] [4]. In the context of our study, we identified an imbalance in the class distribution within the dataset we employed. To rectify this imbalance, we adopted the ROS method. For a more detailed explanation of ROS, please consult Section 4.2. In this study, we partitioned the dataset into two distinct subsets: a training set and a validation set, employing a predefined split ratio of 80% for the training set and 20% for the validation set. The creation of these training and validation datasets is a fundamental step in model development [3], as it allows us to assess and fine-tune the model's performance effectively. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Regulation Limit** \\ \hline TDS & 500 mg/L \\ Turbidity & 5 NTU \\ Iron & 0.3 mg/L \\ Fluoride & 1.5 mg/L \\ Total hardness & 500 mg/L \\ Chloride & 250 mg/L \\ Manganese & 0.4 mg/L \\ Nitrate & 50 mg/L \\ Nitrite & 3 mg/L \\ pH & 6.5–8.5 \\ Zinc & 3 mg/L \\ Sulfate & 250 mg/L \\ Methylene Blue & - mg/L \\ Organic & 10 mg/L \\ Temperature & Air temperature \(\pm\) 3 \\ E-coli bacteria & 100 amount per 100 mL sample \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameter description.