Piles, which are classified as deep foundations, are used in civil engineering applications to provide stable support for structures by being driven into the earth. Given the substantial load-bearing capacity of such foundations, it is essential to consider their settling throughout the design process meticulously. Hence, the management and assessment of settlement pose a noteworthy concern in the realm of piling design and construction. The main goal of the current research is to assess the appropriateness of using a neural network model utilizing optimal support vector regression (SVR) analysis to forecast the settling of piles (SP) in rock formations. Both the Aquila optimizer (AO) and the Henry gas solubility optimizer (HGSO) were merged with SVR to get the best possible values for SVR's crucial factors. The purpose of this research is to show that the predetermined methods have not been used to forecast the SP in rocks. The results indicate that both SVR-AO and SVR-HGSO show considerable potential in accurately predicting the SP. Specifically, the SVR-AO model achieved coefficient of determination (R2) values of 0.9957 and 0.994 during its learning and testing phases, while the SVR-HGSO model achieved R2 values of 0.9888 and 0.9893, respectively. The results of OBJ presented that the SVR-AO model got the minimum OBJ at 0.2187 in contrast to SVR-HGSO at 0.3436. The results of this study are more powerful and accurate than the literature by gaining the higher values of R2 and lower values of error-based metrics. Our research establishes a robust framework for accurately estimating SP in rock formations, offering practical implications for enhancing the design and construction of pile foundations in civil engineering applications. Ultimately, the goal is to leverage machine learning to solve complex problem, make accurate predictions, automate tasks, and gain insights from data.