The utilization of machine learning (ML) approaches for predicting pile bearing capacity (PBC) has been a focal point in various research endeavors. Nevertheless, the inherent limitations of some ML methods, specifically their challenges in identifying global minima and their dilatory convergence rate, constitute the principal drawbacks when employing this methodology. This present investigation was dedicated to the development of an ML-based predictive model that has been enriched through optimization algorithms. Models were developed employing a Regression Decision Tree (DT) along with two optimizers, including the Artificial Hummingbird Algorithm (AHA) and Coot Optimization Algorithm (COA). The inputs encompassed mean cohesion, mean friction angle, mean soil-specific weight, mean pile-soil friction angle, flap number, pile area, and pile length. At the same time, the model's output was defined as the ultimate bearing capacity of the piles. The relationship between input parameters and the output was determined. The outcomes of this study demonstrated a significant alignment between the PBC predictions generated by the Regression Decision Tree optimized with Artificial Hummingbird Algorithm (DTAH) and the actual measured bearing capacities. The high coefficient of determination and low Root Mean Square Error values, specifically 0.998 and 89.29 (KN), respectively, for the testing datasets, underscore the value of employing optimized DT models as robust, efficient, and pragmatic tools for predicting PBC, offering substantial advantages in the field of civil and geotechnique engineering.