Abstract
BACKGROUND: Machine learning (ML) gained recent popularity because of its usefulness and applicability in medicine. Surgical specialties utilize ML for patient selection, optimization, and prediction of outcomes. OBJECTIVES: The aim of the authors of this study is to develop, validate, and compare ML algorithms for prediction of gender-affirming mastectomy complications. METHODS: Analysis of gender-affirming mastectomies performed by the senior author was performed retrospectively. Six ML algorithms were trained and optimized based on a portion of the data and tested on the remainder. Models were compared in accuracy of prediction, sensitivity, specificity, positive predictive value (PPV), and negative predictive value (NPV). Receiver operating characteristic (ROC) curves were computed for each model, and the area under the curve (AUC) was calculated. RESULTS: A total of 268 patients comprised the entire dataset, of which 214 were utilized to train the models. Random forest (RF) and K-nearest neighbors demonstrated the highest model accuracies of 92.6%, closely followed by XGBoost with 90.7%, and neural networks and support vector machine with 88.9%. Logistic regression recorded the lowest final accuracy of 87.0%. Sensitivity ranged from 61.90% for the K-nearest neighbors model to 90.48% for the neural networks model, whereas specificity reached 100% in RF and XGBoost. Logistic regression, RF, and support vector machine showed strong PPV and NPV metrics. AUC score was led by RF, at 0.904. CONCLUSIONS: RF demonstrated the highest accuracy and AUC, with similarly high specificity value and PPV. Application of ML algorithms may be useful for predicting gender-affirming mastectomy complications and could aid surgeons in patient selection.