To mitigate overfitting in high-dimensional scenarios, RF ensembles multiple decision trees and makes predictions based on their aggregated results rather than relying on a single direct prediction. Within the forest, each tree is trained using randomly selected data subsets generated via bagging (bootstrap aggregation), where samples are drawn with replacement from the original dataset. This randomness reduces inter-tree correlations, resulting in greater accuracy and robustness against overfitting . After the establishment of the decision trees, the model then aggregates the outputs of the individual trees to generate an overall prediction for unseen data points, see Fig. .