ObjectivePost-stroke epilepsy (PSE) is a significant complication that has a negative impact on the prognosis and quality of life of ischemic stroke patients. We collected medical records from multiple hospitals and created an interpretable machine learning model for prediction.MethodsWe collected medical records, imaging reports, and laboratory tests from 21459 patients with a history of ischemic stroke in several hospitals. We conducted traditional univariable and multivariable statistics analyses to compare and identify important features. Then the data was divided into a 70% training set and a 30% testing set. We employed the Synthetic Minority Oversampling Technique method to augment the positive class in the training set. Nine commonly used methods were used to build machine learning models, and relevant prediction metrics were compared to select the best-performing model. Finally, we used SHAP(SHapley Additive exPlanations) for model interpretability analysis, assessing the contribution and clinical significance of different features to the prediction.ResultsIn the traditional regression analysis, complications such as hydrocephalus, cerebral hernia, uremia, deep vein thrombosis; significant brain regions included the involvement of the cortical regions including frontal lobe, parietal lobe, occipital lobe, temporal lobe, subcortical region of basal ganglia, thalamus and so on contributed to PSE. General features such as age, gender, and NIHSS(the National Institutes of Health Stroke Scale) score, as well as laboratory indicators including WBC count, D-dimer, lactate, HbA1c and so on were associated with a higher likelihood of PSE. Patients with conditions such as fatty liver, coronary heart disease, hyperlipidemia, and low HDL had a higher likelihood of developing PSE. The machine learning models, particularly tree models such as Random Forest, XGBoost, and LightGBM, demonstrated good predictive performance with an AUC of 0.99.ConclusionThe model built on a large dataset can effectively predict the likelihood of PSE, with tree-based models performing the best. The NIHSS score, WBC count and d-dimer were found to have the greatest impact.