BACKGROUND: Cognitive impairment and depressive symptoms are prevalent and closely interrelated mental health issues in the elderly. Traditional methods for identifying depressive symptoms in this population often lack effectiveness. Machine learning provides a promising alternative for developing predictive models that can facilitate early identification and intervention. METHODS: This study utilized data from 945 participants aged 60 years and older with cognitive impairment, sourced from National Health and Nutrition Examination Surveys (2011-2014). Depressive symptoms were assessed using the Patient Health Questionnaire-9. Lasso regression was applied for feature selection, ensuring consistency across models. Several machine learning models, including XGBoost, Logistic Regression, Random Forest, and SVM, were trained and evaluated. Model performance was assessed using accuracy, precision, recall, F1 score, and AUC. RESULTS: The incidence of depressive symptoms in older adults with cognitive impairment was 14.07%. Key predictors identified by lasso included general health, memory difficulties, and age, among others. Notably, general health emerged as a novel and significant predictor in this population, underscoring the interplay between physical and mental health. XGBoost was the best model for comprehensively comparing discrimination, calibration, and clinical utility. CONCLUSIONS: Machine learning models, particularly XGBoost, effectively predict depressive symptoms in cognitively impaired older adults. The findings highlight the importance of physical, cognitive, and social factors in depressive symptoms risk. These models have the potential to assist in early screening and intervention, improving patient outcomes. Future research should explore ways to enhance model generalizability, including the use of clinically diagnosed depressive symptoms data and alternative feature selection approaches.