# Modeling Soil Temperature with Fuzzy Logic and Supervised Learning Methods
## 3 Results
### Performance Evaluation of the Machine Learning Models
\begin{table}
\begin{tabular}{l c} \hline \hline
**Hyperparameters Tuned** \\ \hline
**MLP** \\ Number of hidden layers & 1 \\ Number of neurons in hidden & 3 \\ Layer & \\ Algorithm & Levenberg–Marquardt \\ Transfer function in hidden Layer & Tansig \\ Transfer function in output Layer & [PERSON] \\ Number of epochs & 200 \\ Network structure & 2-3-1 \\ \hline
**KNN** \\ Optimal neighbor & 9 \\ Weights & Uniform \\ Distance function & Euclidean distance function \\ \hline
**SVR** \\ Error term of penalty parameter (C) & 14.05 \\ Radius (\(\varepsilon\)) & 0.763 \\ Kernel coefficient (\(\gamma\)) & 0.001 \\ \hline
**RF** \\ Number of estimators & 78 \\ Maximum depth & 5 \\ Maximum features & Sqrt \\ Minimum samples leaf & 2 \\ Minimum samples split & 5 \\ \hline
**XGB** \\ Number of estimators & 91 \\ Number of learning rates & 0.06 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Hyperparameter values used in machine learning models. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline \multirow{2}{*}{**Models**} & \multicolumn{3}{c}{**Training**} & \multicolumn{3}{c}{**Testing**} \\ \cline{2-7}  & **MAE** & **RMSE** & **R\({}^{2}\)** & **MAE** & **RMSE** & **R\({}^{2}\)** \\ \hline MLP & 1.47 & 1.99 & 0.93 & 1.75 & 2.23 & 0.93 \\ KNN & 1.46 & 1.93 & 0.94 & 1.83 & 2.37 & 0.92 \\ SVR & 1.43 & 1.95 & 0.93 & 1.70 & 2.17 & 0.93 \\ RF & 1.09 & 1.49 & 0.96 & 1.60 & 2.09 & 0.94 \\ XGB & 1.06 & 1.43 & 0.97 & 1.82 & 2.30 & 0.92 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Evaluation metrics of machine learning models on training and testing dataset. In the XGB model, the number of boosting iterations was set to 91 and the learning rate to 0.06. The relatively low learning rate allowed the model to learn in a more stable and gradual manner, while the number of iterations was sufficient to achieve high predictive accuracy without overfitting. These hyperparameter selections reflect a strategic balance between model complexity and generalization capacity. The configuration of the SVR model, combining a high \(C\) with a small \(\gamma\), was based on established best practices for producing accurate yet generalizable models [58]. Similarly, ensemble models, such as RF and XGB, were optimized for both diversity and learning stability [59]. The soil temperature prediction performance of the machine learning models is summarized in Table 9. The XGB model demonstrated the highest accuracy on the training data, with an R\({}^{2}\) of 0.97, an MAE of 1.06 \({}^{\circ}\)C, and an RMSE of 1.43 \({}^{\circ}\)C. The RF model followed closely, achieving an R\({}^{2}\) of 0.96, an MAE of 1.09 \({}^{\circ}\)C, and an RMSE of 1.49 \({}^{\circ}\)C. In terms of generalization to the testing dataset, RF outperformed the other models with the highest R\({}^{2}\) value of 0.94, indicating superior generalization capability. Although XGB had slightly higher error metrics on the testing data (MAE = 1.82 \({}^{\circ}\)C, RMSE = 2.30 \({}^{\circ}\)C), its overall performance remained robust (R\({}^{2}\) = 0.92). By contrast, the SVR, KNN, and MLP models exhibited relatively lower accuracy, with higher error values across both datasets. Among these, the KNN model showed the weakest generalization performance with an R\({}^{2}\) of 0.92 on the testing set. These results suggest that ensemble-based models, particularly RF and XGB, are more effective in capturing the complex relationships governing soil temperature variation. Therefore, they represent promising tools for predictive modeling in agricultural and environmental applications.