# Water Quality Evaluation and Analysis by Integrating Statistical and Machine Learning Approaches
## 3 Methods
### Statistical Analysis
#### 3.2.1 Feature Importance Analysis Method  
Feature importance analysis assessed the contribution of each water quality parameter to the predictive model's performance. This analysis was crucial for optimizing the hybrid model, which combined Decision Tree Regression (DTR), Autoregressive Integrated Moving Average (ARIMA), and Random Forest (RF) Classification. Figure 2 presents the step-by-step procedure.  
For tree-based models (DTR and RF), feature importance was determined based on impurity reduction at decision nodes [40]. In DTR, significance was measured by variance reduction at nodes utilizing the feature. The importance score for each feature was  
Figure 2: Procedure for analysing feature importance.  
computed by aggregating impurity reduction across decision trees. Normalization ensured consistency and comparability across models.  
ARIMA is inherently a univariate time-series forecasting model that is included in this study to assess the individual temporal predictability of each water quality parameter [41]. To achieve this, each parameter is treated as an independent time series, and an ARIMA model (\(p\) = 4, d = 0, q = 3) is fitted separately. The Mean Squared Error (MSE) from each forecast is used as a proxy to infer how strongly a parameter exhibits consistent temporal structure. Lower MSE values are interpreted as indicative of higher individual predictability, but not as multivariate feature importance. This approach does not account for interactions between features and is not intended to replace conventional importance measures. Rather, it complements the insights obtained from tree-based models, DTR, and RF, which provide multivariate feature importance based on variance reduction and impurity measures. By combining these models, the study offers a richer understanding of both temporal and structural relevance of features within the dataset.  
The integration of DTR, ARIMA, and RF models in this study serves complementary purposes. DTR and RF are tree-based models that effectively capture non-linear relationships and interactions among features, whereas ARIMA is well-suited for capturing linear temporal trends and autocorrelation in time-series data. By combining these models, the approach leverages the strengths of each: DTR for explainable regression, RF for robust classification and feature ranking, and ARIMA for analyzing temporal dependencies in individual parameters. This hybrid framework allows for a more comprehensive analysis of water quality dynamics, accommodating both the static feature-based relationships and temporal patterns inherent in environmental datasets.  
Figure 3 illustrates the hybrid modeling framework used in this study, where time series water quality data are processed through three parallel modeling approaches: ARIMA, DTR, and RF. In this hybrid framework, the DTR model is used to predict continuous WQI values, offering precise numerical forecasts. Concurrently, the RF classifier categorizes WQI into qualitative water quality classes based on Malaysian national water standards. These outputs were used in parallel rather than sequentially. This dual approach enables the system to provide both detailed regression outputs and interpretable classification results, which is particularly useful for both technical analysis and decision-making in water resource management.  
ARIMA is applied to capture linear temporal dependencies and patterns in individual parameters. Simultaneously, DTR performs regression analysis to generate continuous  
Figure 3: Conceptual framework of the hybrid model integrating ARIMA, DTR, and RF.  
predictions of the WQI, while RF classifies the data into categorical water quality classes based on national standards. The outputs from DTR and RF are used in parallel to provide both detailed numerical forecasting and easily interpretable class labels, enabling a comprehensive and flexible analysis of water quality dynamics.