# The Power of Machine Learning Methods and PSO in Air Quality Prediction
## 5 Discussions  
This study used machine learning regressors such as support vector regression, random forest, XGBoost, and linear regression to make air quality predictions. First, the models were trained with standard hyperparameters, and the obtained performance measurements were analyzed. Then, the prediction accuracies were evaluated by optimizing the hyperparameters of the models with the particle swarm optimization method. The results demonstrated that the models optimized with PSO significantly decreased error rates and increased prediction accuracy. In particular, the SVR and XGBoost models reached the highest accuracy level after optimization, significantly reducing error rates. The reduction in the MAE value of the SVR model from 0.461 to 0.047 and the RMSE value from 1.113 to  
Figure 5: Actual prediction comparison of PSO-optimized models. 0.074 revealed the effectiveness of PSO on this model. Low error values were achieved in the RF model before optimization, but the gain remained after optimization. This shows that the RF model could perform well even with the default hyperparameters, but PSO had a limited effect on further improving this model. PSO optimization did not provide any improvement due to the lack of hyperparameters that could be optimized for the linear regression model. Table 5 compares some of the similar studies in the literature. The dataset used in this study was small compared with dataset sizes used in air quality index, air quality degree, and CO\({}_{2}\) emission estimation studies. Despite this, the outcomes demonstrated the effectiveness of the suggested approach. However, the small size of the dataset used in this study limits the generalization ability of the model. Small datasets increase the risk of overfitting, especially in models with high accuracy. Furthermore, computational efficiency poses some challenges due to the iterations of the PSO algorithm. This leads to an increase in processing time for larger datasets. However, a balance between accuracy and computational time is achieved due to the small amount of data. The dataset used in this study included values from a highly polluted area in a city in Italy [15]. However, since the data were acquired between March 2004 and February 2005, there were seasonal variations. This indicates that the data were in a highly dynamic atmospheric transport environment. The raw dataset consisted of 9357 data. The small number of datasets used in the method was due to the cleaning of the data by preprocessing steps. Although the amounts of data were small, they were meaningful data cleaned by preprocessing. This provided high success in the proposed method. Figure 6 shows the SHAP analysis of the SVR model with hyperparameter optimization performed with the PSO algorithm, which achieved the best result in this study. It  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Author/Year** & **Task** & **Dataset** & **Method** & **Results** \\ \hline \multirow{3}{*}{[5]/2023} & \multirow{3}{*}{AQI prediction} & 1920 raw data & & RMSE: 0.76 \\  & & containing 23 & \multirow{3}{*}{CatBoost} & MSE: 0.58 \\  & & components & & R\({}^{2}\): 0.999 \\  & & & MAE: 0.60 \\ \multirow{3}{*}{[6]/2024} & \multirow{3}{*}{AQ prediction} & From Kaggle & Random Forest & Acc. : 1 \\  & & 23,463 instances & \multirow{3}{*}{Naive Bayes} & Acc. 0.52 \\  & & World Weather & & \\  & & Repository & & \\  & & & & \\  &was essential to perform SHAP analysis to understand the decision mechanism of the model [21]. The analysis revealed the effect of the variables related to the model's inputs on the target variable. The SHAP values on the horizontal axis show the contribution of each variable to the model estimate. Positive SHAP values caused the estimated target variable to increase, while negative SHAP values caused the forecast to decrease. The vertical axis shows the independent variables used by the model in the learning process. The color scale indicates the values of the variables; blue indicates low values, and red indicates high values.