# Prediction of Pile Axial Bearing Capacity Using Artificial Neural Network and Random Forest
## 5 Results and Discussion  
### Comparison of RF and ANN  
The effectiveness of RF and ANN models is evaluated in this section. The parameters of ANN and RF used in this study are given in Tables 3 and 4, respectively. The prediction performance in a regression form is shown in Figures 6 and 7 for the training and testing datasets, respectively, whereas a summary of the corresponding information is indicated in Table 5. It is worth mentioning that the results presented herein were transformed into the normal range.  
Considering the testing dataset, the RF model yielded the best prediction results with respect to R\({}^{2}\), RMSE, MAE, the mean of error m\({}_{\text{error}}\), and StDerror (i.e., R\({}^{2}\) = 0.866, 0.809; RMSE = 98.161, 116.366; MAE = 2.924, 3.190; m\({}_{\text{error}}\) = 0.573%, 1.202%; StD\({}_{\text{error}}\)r =9.461%, 10.786% using RF and ANN, respectively). The MAE value of RF was slightly higher in the training part but much lower in the testing one compared to ANN because the performance of such a model might be influenced by choice of the selected index of the training data.  
Figure 6: Graphs of regression results between measured P\({}_{\text{u}}\) versus predicted Pu for the training part using (**a**) ANN, (**b**) RF, (**c**) mean error ANN, (**d**) mean error RF, (**e**) standard deviation ANN, and (**f**) standard deviation RF.  
From a statistical point of view, the performance of ANN and RF algorithms needs to be fully evaluated. The above results showed that the RF model was better than ANN in predicting the bearing capacity of piles. As mentioned in the simulation procedure, 70% of the experimental data were randomly selected in order to construct and train the ANN and RF black boxes. The performance of such a model might be influenced by the choice of the sample indexes to construct the training dataset. Therefore, a total number of 1000 numerical simulations were next carried out, taking into account the random splitting effect in the dataset. The repetition of a simulation taking into account  
Figure 7: Graphs of regression results between measured \(P_{u}\) versus predicted \(P_{u}\) for the testing part using (**a**) ANN, (**b**) RF, (**c**) mean error ANN, (**d**) mean error RF, (**e**) standard deviation ANN, and (**f**) standard deviation RF.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Part** & **Method** & **R\({}^{2}\)** & **MAE (kN)** & **RMSE (kN)** & **m\({}_{\text{error}}\) (\%)** & **StD\({}_{\text{error}}\) (\%)** \\ \hline \multirow{2}{*}{Training} & ANN & 0.818 & 1.050 & 114.882 & 0.884\% & 10.605\% \\  & RF & 0.969 & 2.178 & 47.333 & 0.0699\% & 4.223\% \\ \multirow{2}{*}{Testing} & ANN & 0.809 & 3.190 & 116.366 & 1.202\% & 10.786\% \\  & RF & 0.866 & 2.924 & 98.161 & 0.573\% & 9.461\% \\ \hline \hline \end{tabular}
\end{table}
Table 5: Summary of prediction capability the random effect of input could also be called the Monte Carlo simulations, which is well-known in the literature [69]. The R\({}^{2}\) values of these simulations are plotted in Figure 8a,c, and the corresponding histograms are plotted in Figure 8b,d. It was observed that the proposed RF model gave satisfactory R\({}^{2}\) values within the range of 0.83 to 0.87. The most frequent R\({}^{2}\) obtained over 1000 simulations was R\({}^{2}\) = 0.855 with a frequency of about 170. Besides, ANN algorithm showed a lower accuracy when R\({}^{2}\) values ranged from 0.78 to 0.84 with the most frequent values of R\({}^{2}\) = 0.82 (frequency of about 260). Summarized values of the accuracy corresponded to the two models for the testing part is presented in Table 6.  
It could thus be concluded that RF and ANN algorithms had high potential to predict the bearing capacity of driven piles. However, RF technique yielded better results with average R\({}^{2}\) = 0.861 compare to ANN (average R\({}^{2}\) = 0.811). In conclusion, from the statistical analysis and prediction errors, RF algorithm was the better model to predict the bearing capacity of pile.