Objective To develop a machine learning-based predictive model for the 10-year risk of heart failure and analyze the model's interpretability using the SHAP method,thereby enhancing the accuracy and clinical utility of heart failure risk assessments.Methods The data from the UK Biobank,encompassing 502,349 UK adults aged 40-70 years were used,based on baseline data from 2006-2010.It included 487,572 cases without heart failure and 10,374 cases with heart failure over a 10-year follow-up,defining heart failure events via ICD-10 codes.The prediction models were built using LightGBM,XGBoost and CatBoost machine learning algorithms.The data preprocessing,feature selection and model performance evaluation were conducted in Python and RStudio environments,with the SHAP method used for the visual interpretation of the model's predictive outcomes.Results After balancing the samples through random under sampling,the developed models were capable of effectively predicting the 10-year risk of heart failure.The LightGBM model demonstrated superior predictive performance,followed by CatBoost and XGBoost.The SHAP value analysis revealed that the age,cystatin C,the number of treatments or medications taken,previous diagnoses of vascular or heart issues,and polygenic risk scores were significant predictors of heart failure risk.Conclusion The efficacy of machine learning models in predicting the risk of heart failure is confirmed fine,with the LightGBM model outperforming all the compared models.The analysis of SHAP values offers a new perspective on understanding the drivers behind model predictions,aiding clinical decision-making and risk management.