## 4 Result
### Result of ML Techniques
#### 4.2.3 Random Forest (Random Forest Model)  
The random forest model predicts the variable F based on all other available variables (H, W, I, S). The random Forest was compiled from 500 individual decision trees (ntree = 500). For each node split within each tree, 2 variables (mtry = 2) were randomly selected from the four available predictors (H, W, I, S). The used value of mtry = 2 corresponds with common recommendations for random forest regression, which recommend setting mtry approximately to the square root of the number of input variables. Based on the performed sensitivity analysis of the hyperparameter mtry, we found that higher values, specifically 3 and 4, bring slightly better results in the form of lower RMSE and higher coefficient of determination R\({}^{2}\). However, the difference in model performance between these values and the mtry = 2 value is not very significant. At the same time, it is shown that increasing the number of trees above 500 no longer brings significant improvement. Graphical representation of the sensitivity of random forest model performance to changes in hyperparameters mtry and ntree is in Figure 10.  
During the training, the ability to calculate the importance of variables was activated, which enables later analysis of the impact of individual inputs on the model. Other hyperparameters, such as the minimum number of data points in a leaf node (nodesize = 5), the maximum number of leaf nodes (maxnodes = NULL), and the maximum tree depth (maxdepth = NULL), were left at their default values, which means that trees grow to full depth without restrictions. The importance of variables for model creation and for the prediction of impact force is determined using the Percent Increase in Mean Squared Error (%IncMSE) indicator, which is used by the random forest to determine the importance of input variables for the prediction of the output variable (Figure 11). A high value indicates that the variable is very important for the prediction, and a low value means that the variable has little effect on the prediction. In our case, we found:  
* Variable H is the most important variable, its permutation value is almost 126, which means that the variable is extremely critical for the ability of the Random Forest model to make accurate predictions of the impact force. At the same time, it means that the impact height is the dominant factor and other variables, although important, have a smaller impact on the overall variability of F compared to the impact height. Figure 10: Sensitivity of Random Forest Model Performance. * Variable W is the second most important variable, its permutation value is 90, the variable has a very significant impact on the prediction of the model. * Variable S is the third most important variable; its permutation value is 19. Although it is less important than h and m, it still has a measurable and positive effect on the model. This is a key difference from the original single regression tree, where variable S was of negligible importance. Random Forest, due to its structure (many trees, random selection of variables when dividing), was able to better identify and evaluate the contribution of variable S.
* Variable I has minimal, almost zero importance: Its value is very close to zero and even slightly below zero (\(-\)2.6). This means that its contribution to forecasts is negligible. Removing variable K can even lead to a better model result. Figure 12 shows a graph of the actual values and predicted values that were obtained from the test group. The line represents the ideal prediction, and the red symbols represent those predictions with the largest errors. The chart shows the Top 10 largest errors in the prediction, the values of which are also in Table 5.  
Figure 11: Importance of variables—random forest model. Figure 12: Prediction vs. reality (random forest model). The percentage of variability that the Random Forest model can explain is 96.28%, which has a similar function to the coefficient of determination in the regression model.