# Prediction of Cyanobacteria Using Decision Tree Algorithm and Sensor Monitoring Data
## 2 Research Method
### Data Acquisition  
Water management essentially requires big data techniques because the field involves the collection and processing of various types of information. In this study, data of diverse factors related to water management were collected, and various big data analysis techniques were developed and applied using data mining in order to analyze the characteristics of water quality fluctuations in the Nakdong River Basin and derive customized evaluation measures for establishing practical basin management plans. Additionally, by presenting the utilization of these big data analysis techniques, we aimed to suggest the advanced watershed management direction to take for improving the quality of the water environment that has deteriorated due to drought in the Nakdong River Basin. Figure 1: Geographical positions of the multifunctional weir structures. \begin{table}
\begin{tabular}{c c c c c c c} \hline  
Observation data from the water quality monitoring network, which were collected from 2012 (when construction of the multifunctional weirs was completed) to 2022 and provided by the Water Environment Information System, were used to analyze the patterns of blue-green algae occurrence. For the analysis of factors influencing algae outbreaks, the number of blue-green algae cells was measured by aligning their spatial and temporal resolutions. Data of the following factors were used in this study: inflow to weirs (inflow), outflow from weirs (outflow), hydraulic retention time (HRT), volume of weirs (Water volume of weirs), _E. coil_, pH, electrical conductivity (EC), DO, biological oxygen demand (BOD), total oxygen content (TOC), chemical oxygen demand (COD), total nitrogen (TN), total phosphorus (TP), SS, Chl-a, water temperature (W.T. ), and number of blue-green algae cells (cyanobacteria). To determine the hydrological characteristics of each weir section, the outflow, inflow, and HRT data were used in the analysis. The collected data were partitioned via cluster analysis of the eight weirs, using k-means clustering, an unsupervised learning method known to facilitate the easier clustering and faster computation of big data compared with supervised learning methods. First proposed by [PERSON] (1967) [24], k-means clustering is an algorithm that groups given data into k clusters through the following steps: First, the initial centroid value is randomly selected. Then, the distance between the k-centroid value and each datum is calculated using the Euclidean distance, and the corresponding datum is assigned to the closest cluster. Subsequently, a new centroid value is calculated for each cluster. If the selected centroid value changes little, the process is stopped. If there are continuous changes, the process is repeated from the beginning. The k-means clustering method also requires the specification of an initial number of centroids, which can be carried out using several methods. The most basic is the empirical method, in which the number of clusters is sequentially increased and the ensuing results are monitored and compared with previous results. ### Data Acquisition  
In this study, we developed a decision tree-based prediction model; unlike previous studies that used regression-based models for algae prediction. A decision tree algorithm plots decision rules in the form of a single tree. In the ensemble technique, bagging and boosting methods are used to combine several decision trees according to the status of the mutual influences of each tree to improve the prediction performance of the model [25]. In this study, we used RF, CatBoost, and XGBoost as algorithms to evaluate category-type algae prediction. The selected machine learning algorithms can perform both classification and regression prediction functions. Compared with deep learning, they show faster com  
Figure 2: Annual average blue-green algae occurrence at multifunctional weirs. putational capabilities and better applicability to models based on high-resolution water quality data.