Ultra-high-performance geopolymer concrete (UHPGC) is a new category of traditional UHPC developed to meet the desire for ultra-high-strength and green building materials. In the current study, random forest (RF), support vector regression (SVR), and extreme gradient boosting (XGB) are used to forecast the compressive strength (CS) of UHPGC. Firstly, the findings of the 113 CS tests available in the previous studies were extracted. Twelve feature variables, including GGBS, silica fume, fly ash, and rice husk ash contents as precursors, the Na2SiO3, NaOH, KOH, and extra water content, polypropylene fiber, steel fiber, liquid-to-binder (L/B) ratio, and curing temperature, were investigated. After analyzing the extracted data, it was found that there were more mixtures of steel fiber-based UHPGCs and synthetic fibers compared to mixtures without fibers. This may reduce the accuracy and comprehensiveness of the predictive models used. To address this issue, several experiments were designed, performed, and tested. Overall, the dataset of 128 CS results was used to develop the machine learning (ML) models. The findings validate the effectiveness of the RF, SVR, and XGB models in accurately predicting the strength of the UHPGC, as constructed by their excellent predictive accuracy (R2 > 0.84). The XGB model performance is superior to the RF and SVR models. The feature importance analysis determined that the steel fiber content and L/B ratio were the top two elements that might profoundly impact the CS. Additionally, NaOH and silica fume also have a positive correlation with CS. Conversely, the extra water and percentage of GGBS exhibit a low correlation with the CS. Through the application of ML models, this study not only ascertains the significance of algorithms including RF, SVR, and XGB in precisely forecasting the CS of UHPGC, but also reveals essential understandings regarding the importance of steel fiber content, L/B ratio, and various other pivotal variables, consequently facilitating the development of refined formulations and improved functionalities in eco-friendly construction materials.