RESUMO
This study leverages data from a Canadian database of primary care Electronic Medical Records to develop machine learning models predicting type 2 diabetes mellitus (T2D), prediabetes, or normoglycemia. These models are used as a basis for extracting counterfactual explanations and derive personalized changes in biomarkers to prevent T2D onset, particularly in the still reversible prediabetic state. The models achieve satisfactory performance. Furthermore, feature importance analysis underscores the significance of fasting blood sugar and glycated hemoglobin, while counterfactuals explanations emphasize the centrality of keeping body mass index and cholesterol indicators within or close to the clinically desirable ranges. This research highlights the potential of machine learning and counterfactual explanations in guiding preventive interventions that may help slow down the progression from prediabetes to T2D on an individual basis, eventually fostering a recovery from prediabetes to a normoglycemic state.