Nanofluids, characterized by the dispersion of nanoparticles in a base liquid, have attracted significant attention in recent years due to their exceptional thermal properties. Specifically, the specific heat capacity of nanofluids plays a crucial role in the design and optimization of heat transfer systems. Traditional experimental methods for determining the specific heat capacity of nanofluids are often limited in terms of cost, time, and operating condition ranges. To address these limitations, this research focuses on the development of a novel predictive model for estimating the specific heat capacity of nanofluids. This study aims to develop a machine learning regression model called Gradient Boost Regression (GBR) with Grid Search optimization (GSO) for accurately predicting the specific heat capacity of aluminum nitride (Al2N3) nanoparticles that are suspended in both water and an ethylene glycol (EG) solution. The GBR-GSO model capitalizes on the strengths of GBR, which can effectively capture complex relationships, and GSO, a metaheuristic optimization technique inspired by the law of gravity. By integrating these two approaches, we aim to create a robust and accurate predictive model for specific heat capacity in nanofluids. To develop and validate the GBR-GSO model, a diverse dataset based on experimental-specific heat capacity collected from the literature has been designed. The performance of the model has been evaluated by comparing its predictions with experimental data. The GBR-GSO model achieved 99.99% accuracy with the experimental data of specific heat capacity. This research contributes to the advancement of nanofluid-based heat transfer systems by providing an effective tool for predicting the specific heat capacity of nanofluids. The developed model can facilitate the design and optimization of various engineering applications, leading to the development of energy-efficient and sustainable technologies.