# The Power of Machine Learning Methods and PSO in Air Quality Prediction
## 4 Experimental Results
It is seen that the hyperparameters such as C, epsilon, gamma, max_depth, n_estimators, eta, and sub-sample obtained were optimized for SVR, RF, and XGBoost models. For the SVR model, C = 83.11, epsilon = 0.015, and gamma = 0.771 were determined, while, for the RF model, max_depth = 12.59 and n_estimators = 16.11 were optimized. MSE was used in the objective function of PSO. In the study, \(t\)-tests were used to evaluate the effects of model optimization [25]. The \(t\)-test was used to determine whether the differences in performance between optimized and non-optimized models were statistically significant. The \(p\)-value indicates whether these differences are random; generally, values of \(p\) < 0.05 indicate that optimization has resulted in a significant improvement in performance. However, results with \(p\)-values above 0.05 indicate that the improvement is not statistically significant. Table 4 shows the \(t\)-test results obtained for each model. These results were used to assess whether the improvements of the optimized models were statistically significant. The \(p\)-value for the PSO + SVR model was 0.0559, which was greater than 0.05, so it can be said that the effect of optimization was not statistically significant. However, this result did not affect the strong performance of the model; it was only on the border of statistical significance. Since the \(p\)-value of the PSO + RF model was high with 0.5988, the effect of optimization on this \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **MAE** & **MSE** & **RMSE** & **R\({}^{2}\)** & **Opt.** & **Training** \\  & & & & & **Time (s)** & **Time (s)** \\ \hline PSO + SVR & 0.071 & 0.015 & 0.122 & 0.999 & 0.125 & 0.993 \\ PSO + RF & 0.065 & 0.022 & 0.150 & 0.999 & 0.138 & 14.440 \\ PSO + XGBoost & 0.082 & 0.018 & 0.133 & 0.999 & 0.326 & 21.032 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Time and performance measurement results of machine learning regressors with hyperparameter optimization. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & **C** & **Epsilon** & **Gamma** & **Max** & **n\_Estimators** & **Eta** & **Subsample** & **Fit\_Intercept** \\ \hline PSO + SVR & 83.11 & 0.015 & 0.771 & N/A & N/A & N/A & N/A & N/A \\ PSO + RF & N/A & N/A & N/A & 12.59 & 16.11 & N/A & N/A & N/A \\ PSO + XGBoost & N/A & N/A & N/A & 7.143 & 678.9 & 0.161 & 0.714 & N/A \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Optimum hyperparameters obtained with PSO. model was not statistically significant. PSO + XGBoost: With a \(p\)-value of 0.0005, this model clearly showed that optimization provided a statistically significant improvement. This shows that the improvement in the XGBoost model was strong and significant. The prediction performances of three different machine learning models are presented in Figure 4 compared with the actual values. Each subgraph includes the fundamental values on the horizontal axis and the predictions made by the model on the vertical axis. In addition, the model's performance on both datasets was analyzed by showing the training and test set predictions in different colors. The prediction performance of the SVR + PSO model was high. The training and test data predictions exhibited a distribution very close to the 45-degree reference line. This shows that the model can make high-accuracy predictions and has good generalization ability. The error rate was low, and no signs of over-learning were observed. The training and test data points of the RF + SVR model were located very close to the actual values, which shows that its prediction success was high. However, the slight deviations, especially in the upper values, show that the model successfully learned complex data relationships but could make minor generalization errors in certain regions. The XGBoost + PSO model was quite successful in terms of accuracy. The predictions on the training and test data were located close to the reference line, and no serious deviations were observed.