© 2020 Elsevier Ltd Forecasting imminent accidents in power infrastructure projects require a robust and accurate prediction model to trigger a proactive strategy for risk mitigation. Unfortunately, getting ready-made machine learning algorithms to eliminate redundant features optimally is challenging, especially if the parameters of these algorithms are not tuned. In this study, a particle swarm optimization is proposed both for feature selection and parameters tuning of the gradient boosting machine technique on 1,349,239 data points of an incident dataset. The predictive ability of the proposed method compared to conventional tree-based methods revealed near-perfect predictions of the proposed model on test data (classification accuracy − 0.878 and coefficient of determination − 0.93) for the two outcome variables ACCIDENT and INJURYFREQ. The high predictive power obtained reveals that injuries do not occur in a chaotic fashion, but that underlying patterns and trends exist that can be uncovered and captured via machine learning when applied to sufficiently large datasets. Also, key relationships identified will assist safety managers to understand possible risk combinations that cause accidents; helping to trigger proactive risk mitigation plans.