Upper limb lymphedema is one of the most common adverse events related to surgery owing to the large gap between guideline implementation and the intended clinical outcomes. However, the monitoring of limb lymphedema remains challenging because of vague clinical presentations. This study aimed to develop and validate practical predictive models for upper limb lymphedema through machine learning. We retrospectively collected clinical data to develop models for early risk prediction of upper limb lymphedema based on a single-center electronic health record data from patients who underwent breast cancer surgery from June 2021 through June 2023. For prediction model building, 70% and 30% of the data were randomly split into training and testing sets, respectively. We then developed an upper limb lymphedema prediction model using machine learning algorithms, which included random forest model (RFM), generalized logistic regression model (GLRM), and artificial neural network model (ANNM). For evaluating the model's performance, we used the area under the receiver operating characteristic curve (AUROC), calibration curve to compare different models. The potential clinical usefulness of the best model at the best threshold was assessed through a net benefit approach using a decision curve analysis (DCA). Of the 3201 patients screened for eligibility, 3160 participants were recruited for the prediction model. Among these, Body Mass Index (BMI), hypertension, TNM, lesion site, level of lymph node dissection(LNMD), treatment, and nurse were independent risk factors for upper limb lymphedema and were listed as candidate variables of ML-based prediction models. The RFM algorithm, in combination with seven candidate variables, demonstrated the highest prediction efficiency in both the training and internal verification sets, with an area under the curve (AUC) of 0.894 and 0.889 and a 95% confidence interval (CI) of 0.839-0.949 and 0.834-0.944, respectively. The other two types of prediction models had prediction efficiencies between AUCs of 0.731 and 0.819 and 95% CIs of 0.674-0.789 and 0.762-0.876, respectively. The interpretable predictive model helps physicians more accurately predict the upper limb lymphedema risk in patients undergoing breast cancer surgery. Especially for the RFM, this newly established machine learning-based model has shown good predictive ability for distinguishing high risk of upper limb lymphedema, which could facilitate future clinical decisions, hospital management, and improve outcomes.