Distinguishing warfarin-related bleeding risk at the bedside remains challenging. Studies indicate that warfarin therapy should be suspended when international normalized ratio (INR) ≥ 4.5, or it may sharply increase the risk of bleeding. We aim to develop and validate a model to predict the high bleeding risk in valve replacement patients during hospitalization. Cardiac valve replacement patients from January 2016 to December 2021 across Nanjing First Hospital were collected. Five different machine-learning (ML) models were used to establish the prediction model. High bleeding risk was an INR ≥4.5. The area under the receiver operating characteristic curve (AUC) was used for evaluating the prediction performance of different models. The SHapley Additive exPlanations (SHAP) was used for interpreting the model. We also compared ML with ATRIA score and ORBIT score. A total of 2376 patients were finally enrolled in this model, 131 (5.5%) of whom experienced the high bleeding risk after anticoagulation therapy of warfarin during hospitalization. The extreme gradient boosting (XGBoost) exhibited the best overall prediction performance (AUC: 0.882, confidence interval [CI] 0.817-0.946, Brier score, 0.158) compared to other prediction models. It also shows superior performance compared with ATRIA score and ORBIT score. The top 5 most influential features in XGBoost model were platelet, thyroid stimulation hormone, body surface area, serum creatinine and white blood cell. A model for predicting high bleeding risk in valve replacement patients who treated with warfarin during hospitalization was successfully developed by using machine learning, which may well assist clinicians to identify patients at high risk of bleeding and allow timely adjust therapeutic strategies in evaluating individual patient.