Energy scenarios, relying on wide-ranging assumptions about the future, do not always adequately reflect the lock-in risks caused by planned power-generation projects and the uncertainty around their chances of realisation. In a study recently published in Nature Energy, we built a machine-learning model that predicts power-generation project failure and success using the largest dataset on historic and planned power plants available for Africa, combined with country-level characteristics. We found that the most relevant factors for successful commissioning of past projects are at plant level: capacity, fuel, ownership and connection type. We applied the trained model to predict the realisation of the current project pipeline. Contrary to rapid transition scenarios, our results show that the share of non-hydro renewables in electricity generation is likely to remain below 10% in 2030, despite total generation more than doubling. These findings point to high carbon lock-in risks for Africa, unless a rapid decarbonization shock occurs leading to large-scale cancellation of the fossil fuel plants currently in the pipeline.