ImportanceAlthough numerous prognostic factors have been found for patients after lung transplantation (LTx) over the years, an accurate prognostic tool for LTx recipients remains unavailable.ObjectiveTo develop and validate a prognostic model for predicting overall survival in patients after LTx using random survival forests (RSF), a machine learning algorithm.Design, Setting, and ParticipantsThis retrospective prognostic study included patients who underwent LTx between January 2017 and December 2020. The LTx recipients were randomly assigned to training and test sets in accordance with a ratio of 7:3. Feature selection was performed using variable importance with bootstrapping resampling. The prognostic model was fitted using the RSF algorithm, and a Cox regression model was set as a benchmark. The integrated area under the curve (iAUC) and integrated Brier score (iBS) were applied to assess model performance in the test set. Data were analyzed from January 2017 to December 2019.Main Outcomes And MeasuresOverall survival in patients after LTx.ResultsA total of 504 patients were eligible for this study, consisting of 353 patients in the training set (mean [SD] age, 55.03 [12.78] years; 235 [66.6%] male patients) and 151 patients in the test set (mean [SD] age, 56.79 [10.95] years; 99 [65.6%] male patients). According to the variable importance of each factor, 16 were selected for the final RSF model, and postoperative extracorporeal membrane oxygenation time was identified as the most valuable factor. The RSF model had excellent performance with an iAUC of 0.879 (95% CI, 0.832-0.921) and an iBS of 0.130 (95% CI, 0.106-0.154). The Cox regression model fitted by the same modeling factors to the RSF model was significantly inferior to the RSF model with an iAUC of 0.658 (95% CI, 0.572-0.747; P < .001) and an iBS of 0.205 (95% CI, 0.176-0.233; P < .001). According to the RSF model predictions, the patients after LTx were stratified into 2 prognostic groups displaying significant difference, with mean overall survival of 52.91 months (95% CI, 48.51-57.32) and 14.83 months (95% CI, 9.44-20.22; log-rank P < .001), respectively.Conclusions and relevanceIn this prognostic study, the findings first demonstrated that RSF could provide more accurate overall survival prediction and remarkable prognostic stratification than the Cox regression model for patients after LTx.