# Modeling Soil Temperature with Fuzzy Logic and Supervised Learning Methods
## 3 Results
### Performance Evaluation of the Machine Learning Models  
Data pre-processing constitutes a critical step in developing robust and accurate machine learning models. In this phase, important issues such as noise, missing values, and inconsistencies within the dataset are addressed. The pre-processing workflow included standard procedures, such as data cleansing, transformation, and stratified partitioning. To eliminate the effects of different units of measurement and to mitigate the influence of outliers, all feature values were normalized to a range of 0-1. The data set was temporally split into a training set (2016-2021) and a testing set (2022-2024). For model calibration, 90% of the training data was used and hyperparameter tuning was performed on a randomly selected 90% subset of this training pool. This process was repeated with ten-fold cross-validation to ensure statistical rigor and to enhance the reliability of the model performance evaluation. The final hyperparameter configurations of the machine learning models employed in this study are summarized in Table 8.  
The performance outcomes of the machine learning models are comprehensively summarized in Table 9, which presents the MAE, RMSE, and R\({}^{2}\) values for both training and testing stages. The MLP architecture, a compact network configuration was adopted to balance model complexity and generalization ability. The selected structure comprised a single hidden layer with three neurons, resulting in a (2-3-1) topology. This configuration was deemed sufficient to capture the fundamental relationships within the dataset while mitigating the risk of overfitting. The Levenberg-Marquardt (LM) optimization algorithm was employed for training, owing to its proven efficiency and speed in handling nonlinear regression tasks. The activation functions used were hyperbolic tangent sigmoid (tansig) in the hidden layer and linear (purelin) in the output layer. The model was trained for 200 epochs to ensure convergence without overtraining. \begin{table}
\begin{tabular}{l l l l l l l l l} \hline \hline \multirow{2}{*}{**Input Combinations**} & \multicolumn{2}{c}{**Membership Function**} & \multicolumn{2}{c}{**Training**} & \multicolumn{3}{c}{**Testing**} \\ \cline{2-9}  & **Input** & **Output** & **MAE** & **RMSE** & **R\({}^{2}\)** & **MAE** & **RMSE** & **R\({}^{2}\)** \\ \hline \multirow{6}{*}{Soil depth (cm)} & Trimf (3 \(\times\) 3) & Linear & 1.46 & 1.97 & 0.94 & 1.49 & 1.97 & 0.95 \\  & Trapmf (3 \(\times\) 3) & Linear & 1.46 & 1.97 & 0.94 & 1.55 & 1.97 & 0.95 \\  & Gaussmf (3 \(\times\) 3) & Linear & 1.45 & 1.96 & 0.94 & 1.52 & 1.97 & 0.95 \\  & Trimf (4 \(\times\) 4) & Linear & 1.35 & 1.88 & 0.94 & 1.46 & 1.89 & 0.95 \\  & Trapmf (4 \(\times\) 4) & Linear & 1.42 & 1.94 & 0.94 & 1.46 & 1.96 & 0.95 \\  & Gaussmf (4 \(\times\) 4) & Linear & 1.41 & 1.93 & 0.94 & 1.49 & 1.98 & 0.95 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Evaluation metrics of the ANFIS models on training and testing dataset. For the KNN algorithm, the number of neighbors was set to 9, with a uniform weighting scheme, and Euclidean distance was set as the distance metric. This configuration allows the model to be sensitive to local variations in the data space while assuming equal influence from each of the neighboring points. In the SVR model, the penalty coefficient (\(C\) = 14.05), error tolerance (\(\varepsilon\) = 0.763), and kernel coefficient (\(\gamma\) = 0.001) were selected. A high \(C\) value was used to reduce bias and tightly fit the data, whereas a low \(\gamma\) value was preferred to avoid excessive model complexity and to preserve the generalization capability. The RF model was configured with 78 decision trees, a maximum tree depth of five, sqrt as the maximum number of features considered at each split, and parameters for minimum samples per leaf and per split set to two and five, respectively. The restricted tree depth was implemented to prevent overfitting and to promote diversity among the trees.