The economic value of a mineral resource is highly dependent on the accuracy of grade estimations. Accurate predictions of mineral grades can help businesses decide whether to invest in a mining project and optimize mining operations to maximize the resource. Conventional methods of predicting gold resources are both costly and time-consuming. However, advances in machine learning and processing power are making it possible for mineral estimation to become more efficient and effective. This work introduces a novel approach for predicting the distribution of mineral grades within a deposit. The approach integrates machine learning and optimization techniques. Specifically, the authors propose an approach that integrates the random forest (RF) and k-nearest neighbor (kNN) algorithms with the marine predators optimization algorithm (MPA). The RFKNN_MPA approach uses log normalization to reduce the impact of extreme values and improve the accuracy of the machine learning models. Data segmentation and the MPA algorithm are used to create statistically equivalent subsets of the dataset for use in training and testing. Drill hole locations and rock types are used to create each model. The suggested technique’s performance indices are superior to the others, with a higher R-squared coefficient of 59.7%, a higher R-value of 77%, and lower MSE and RMSE values of 0.17 and 0.44, respectively. The RFKNN_MPA algorithm outperforms geostatistical and conventional machine-learning techniques for estimating mineral orebody grades. The introduced approach offers a novel solution to a problem with practical applications in the mining sector.