Maintenance Notice

Due to necessary scheduled maintenance, the JMIR Publications website will be unavailable from Wednesday, July 01, 2020 at 8:00 PM to 10:00 PM EST. We apologize in advance for any inconvenience this may cause you.

Who will be affected?

Previously submitted to: JMIR Medical Informatics (no longer under consideration since May 15, 2026)

Date Submitted: May 5, 2026
Open Peer Review Period: May 15, 2026 - May 15, 2026
(closed for review but you can still tweet)

NOTE: This is an unreviewed Preprint

Warning: This is a unreviewed preprint (What is a preprint?). Readers are warned that the document has not been peer-reviewed by expert/patient reviewers or an academic editor, may contain misleading claims, and is likely to undergo changes before final publication, if accepted, or may have been rejected/withdrawn (a note "no longer under consideration" will appear above).

Peer review me: Readers with interest and expertise are encouraged to sign up as peer-reviewer, if the paper is within an open peer-review period (in this case, a "Peer Review Me" button to sign up as reviewer is displayed above). All preprints currently open for review are listed here. Outside of the formal open peer-review period we encourage you to tweet about the preprint.

Citation: Please cite this preprint only for review purposes or for grant applications and CVs (if you are the author).

Final version: If our system detects a final peer-reviewed "version of record" (VoR) published in any journal, a link to that VoR will appear below. Readers are then encourage to cite the VoR instead of this preprint.

Settings: If you are the author, you can login and change the preprint display settings, but the preprint URL/DOI is supposed to be stable and citable, so it should not be removed once posted.

Submit: To post your own preprint, simply submit to any JMIR journal, and choose the appropriate settings to expose your submitted version as preprint.

Warning: This is an author submission that is not peer-reviewed or edited. Preprints - unless they show as "accepted" - should not be relied on to guide clinical practice or health-related behavior and should not be reported in news media as established information.

Construction and External Validation of a Machine Learning Prediction Model for Depression Risk in Cardiac Patients

  • Xiang Liu

ABSTRACT

Background:

Depression poses a significant risk factor affecting the progression and prognosis of cardiac diseases. Early and accurate identification of depression risk in cardiac patients is therefore essential to enhance treatment outcomes and improve quality of life.

Objective:

This study utilizes data from the National Health and Nutrition Examination Survey (NHANES) to develop and compare multiple machine learning algorithms, aiming to identify the most effective model for predicting depression risk among cardiac patients.

Methods:

This study extracted relevant samples of cardiac patients from the NHANES dataset (2005–2018) as the training set. A five-fold cross-validation strategy was employed for model training and performance evaluation. Six machine learning algorithms were assessed, including a linear model (Logistic Regression) and five ensemble tree-based models: CatBoost, LightGBM, Random Forest, XGBoost, and Gradient Boosting Decision Trees (GBDT). To enhance model interpretability and reduce dimensionality, Recursive Feature Elimination (RFE) was applied individually to each algorithm to identify key features. The NHANES 2021–2023 dataset was used as an independent external validation set to verify the model's generalization ability. The area under the receiver operating characteristic curve (AUC-ROC) was adopted as the primary metric for performance assessment, supplemented by accuracy, precision, sensitivity, specificity, and F1-score. SHapley Additive exPlanations (SHAP) analysis was performed on the independent validation set to interpret feature contributions, and calibration curves and decision curve analysis (DCA) were used to evaluate clinical utility.

Results:

Among the six algorithms, CatBoost achieved the highest predictive performance in five-fold cross-validation (training set), with an average AUC of 0.8220 using 13 key features selected via RFE. In the independent external validation set (NHANES 2021–2023), the CatBoost model maintained robust performance: AUC = 0.8209, accuracy = 0.7582, precision = 0.3514, sensitivity = 0.7027, specificity = 0.7681, and F1-score = 0.4685. SHAP analysis of the validation set confirmed that sleep status, gender, and physical activity remained the most influential predictors of depression risk. The calibration curve (Brier score = 0.1118) indicated good agreement between predicted probabilities and observed outcomes. DCA demonstrated that the model provided positive net clinical benefit across a threshold probability range of 0.05–0.35, outperforming the "treat all" and "treat none" strategies.

Conclusions:

This study systematically evaluated six machine learning models for predicting depression risk in cardiac patients based on nationally representative NHANES data. The CatBoost algorithm exhibited superior predictive accuracy and stability in both internal cross-validation and independent external validation. The integration of RFE-selected features, SHAP interpretation, calibration assessment, and DCA confirmed the model's practical value for clinical application. These findings highlight the potential of advanced machine learning techniques in supporting precision mental health screening for cardiac populations and underscore the model's robustness in real-world settings.


 Citation

Please cite as:

Liu X

Construction and External Validation of a Machine Learning Prediction Model for Depression Risk in Cardiac Patients

JMIR Preprints. 05/05/2026:100441

DOI: 10.2196/preprints.100441

URL: https://preprints.jmir.org/preprint/100441

Download PDF


Request queued. Please wait while the file is being generated. It may take some time.

© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.