# SBNNR: Small-Size Bat-Optimized KNN Regression
## 5 Experimental Results
### Comparison with Grid Search-Optimized KNN  
In order to test our proposed method, several real-world datasets were selected, which are listed in Table 1.  
To evaluate the proposed method, the datasets in Table 1 were modeled using a simple KNN algorithm with grid search on top of it for hyperparameter tuning alongside the proposed method. Table 2 shows the \(R^{2}\) scores and RMSE error rates for the test subset in these methods.  
\(R^{2}\) scores of all three tasks using the proposed method are higher than scores for the same task using KNN with grid search in the test phase. In the training phase, all \(R^{2}\) scores obtained using the proposed method are lower than those obtained by KNN with grid search. According to these facts, the proposed method produces more general models. This is confirmed in the last column of the table, where two of three t  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Instances** & **Features** \\ \hline Biodiesel Production (BP) [37] & 20 & 2 \\ Servo & 167 & 4 \\ Yacht Hydrodynamics (YH) & 308 & 7 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Datasets for experimental assessment.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Method** & **Train \(R^{2}\)** & **Test \(R^{2}\)** & **RMSE** \\ \hline BP & KNN (GridCV) & 0.999 & 0.662 & \(1.74\times 10^{-4}\) \\  & Proposed Method & 0.987 & 0.696 & \(1.74\times 10^{-4}\) \\ \hline Servo & KNN (GridCV) & 1.0 & 0.969 & \(2.49\times 10^{-1}\) \\  & Proposed Method & 0.970 & 0.987 & \(1.57\times 10^{-1}\) \\ \hline YH & KNN (GridCV) & 1.0 & 0.792 & 5.042 \\  & Proposed Method & 0.947 & 0.812 & 5.014 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparison of KNN with GridCV and the proposed method.  
values using the proposed method, while the RMSE for other method is equal to that of KNN with grid search.  
In addition, as an example, a comparison of predicted values and expected values on the servo dataset is shown graphically in Figures 1 and 2. In these figures, the red dots are the predicted values in the test phase, and the blue dots are the predicted values in the training phase, which are comparable to the expected values (green line).  
When we compare the results from the two models, several important observations come to light. In the grid-optimized KNN model, we observe that nearly all data points in  
Figure 1: Predicted (red points for test data and blue points for train data) compared to actual values (green line) of GridCV optimized KNN on the Servo dataset.  
Figure 2: Predicted (red points for test data and blue points for train data) compared to actual values (green line) of the proposed method on Servo dataset.  
the training phase are touched, covering a wide range of the feature space. In contrast, the proposed method demonstrates a more focused distribution of training points, clustering closely around the expected value line.  
However, the most significant distinction arises when we examine the behavior of the models on unseen test data. In the proposed model, none of the test points deviates abnormally from its expected value. Conversely, in the grid search model, a subset of test points exhibits undesirable deviations from the expected values, indicating suboptimal generalization.