In this study, a random forest model was compared to a statistical model for predicting heavy metal concentrations in groundwater in Edo State, Nigeria. The pH of groundwater samples was determined using a pH meter, and heavy metal concentrations were measured with Atomic Absorption Spectrophotometer (AAS). Pearson Correlation Coefficient was used to evaluate correlations between heavy metal concentrations. Both Random Forest Model (RFM) and Multiple Linear Regression (MLR) were employed to model these concentrations, with goodness of fit assessed via R-squared and root mean square error (RMSE). Results showed that heavy metal concentrations, except for lead, were generally within acceptable limits. The RFM outperformed MLR in predicting iron and lead concentrations but was less effective for arsenic. Python was used for modelling and data extraction. Both models are suitable for predicting groundwater contamination, with RFM showing better overall performance.