Accurately predicting the bearing capacity of steel and concrete piles is a critical factor in the design and safety of deep foundations. This study presents a novel application of hybrid machine learning models, specifically Invasive Weed Optimization with Multilayer Perceptron (IWOMLP) and Harris Hawks Optimization with Multilayer Perceptron (HHOMLP), for enhancing the prediction of pile bearing capacity. These hybrid models integrate evolutionary optimization algorithms with neural networks, aiming to improve prediction accuracy by addressing the nonlinearities and complexities in pile-soil interaction. The study compares the performance of IWOMLP and HHOMLP against conventional machine learning methods such as Simple Linear Regression, Gaussian Processes, Random Forest, and others. The training and testing phases evaluate the models based on various error metrics, including R-2, RMSE, MAE, and additional advanced metrics. The key innovation in this research lies in combining optimization techniques with neural networks, which significantly enhances the model's ability to predict complex geotechnical properties. The primary goal of this work is to develop a reliable, data-driven approach for accurate pile capacity prediction, providing a more precise tool for geotechnical engineers to improve decision-making in foundation design. Results indicate that the hybrid models, particularly IWOMLP, outperform traditional approaches, achieving higher R-2 and lower RMSE values. This research demonstrates the potential of hybrid models to advance geotechnical engineering practices by delivering more accurate and reliable predictions.