Machine Learning Prediction of One‐Year Rehospitalization in Dementia: A Retrospective Cohort Study Authors: Amirreza Esmaeili, Vahid Saeedi, Leila Kamalzadeh Published: 2026 ABSTRACT ABSTRACTBackground and AimsPatients with dementia have high rehospitalization rates, creating substantial clinical and economic burden. Machine learning (ML) may help predict readmission risk, but its use for clinically relevant outcomes such as rehospitalization in dementia remains limited. This study evaluated the performance of several ML algorithms for predicting 1‐year rehospitalization in patients with dementia and identified key predictive factors.MethodsIn this retrospective cohort study, data from 606 patients with dementia admitted to a tertiary hospital in Tehran, Iran, between 2016 and 2024 were analyzed. Four ML algorithms—Random Forest (RF), Decision Tree (DT), Logistic Regression (LR), and Extreme Gradient Boosting (XGBoost)—were used to predict rehospitalization within 1 year of discharge. Predictors included demographic variables, dementia subtype, clinician‐assigned functional severity stage based on DSM‐5 criteria, behavioral disturbances, medical and psychiatric comorbidities, number of medications, and length of stay. Model performance was assessed using accuracy, precision, recall, F1‐score, and area under the receiver operating characteristic curve (AUC‐ROC) with fivefold cross‐validation. Feature importance analysis was performed to identify the main predictors.ResultsOf 606 patients, 232 (38.3%) were rehospitalized within 1 year. All models showed strong predictive performance. RF achieved the highest test accuracy (0.929) and AUC‐ROC (0.986), followed by XGBoost (accuracy 0.918, AUC‐ROC 0.982). LR and DT also performed well (LR: accuracy 0.896, AUC‐ROC 0.964; DT: accuracy 0.890, AUC‐ROC 0.965). Feature importance analysis identified functional severity stage, behavioral disturbance, polypharmacy, medical comorbidity burden, and psychiatric comorbidity as major predictors.ConclusionsML models, particularly RF and XGBoost, showed strong performance in predicting 1‐year rehospitalization among patients with dementia. Functional severity stage and behavioral disturbances were among the most important predictors. These findings support the potential use of ML for risk stratification and targeted intervention, although external validation in multicenter settings is needed. Introduction Global Burden of Dementia Dementia is a progressive neurocognitive disorder that significantly impairs cognitive functions, including memory, attention, executive function, language, and perception, leading to substantial declines in daily functioning and quality of life. It includes subtypes such as Alzheimer's disease (AD), vascular dementia, Lewy body dementia, and frontotemporal dementia, each with unique etiologies but shared impacts on patients, caregivers, and healthcare systems [1]. Globally, dementia prevalence reached 57 million cases in 2021, with an annual incidence of 10 million new cases. Driven by population aging, these numbers are projected to rise to 78 million by 2030 and 139 million by 2050 [2]. Dementia is already the seventh leading cause of death and a leading cause of disability in the elderly. The associated economic burden, encompassing direct medical costs and indirect losses from caregiving, totaled $1.3 trillion in 2019 and is expected to exceed $2.8 trillion by 2030 [3, 4]. Rehospitalization in Dementia Patients with dementia experience disproportionately high rates of hospital readmissions, which exacerbate clinical decline and system costs. For example, a cohort study of 723,000 found that 30‐day readmission rates were 21.5% for patients with Alzheimer's disease or related dementias, compared to 14.7% for older adults without dementia, with higher associated costs (median $22,371 vs. $19,578 per episode) [5]. Some subgroups face even greater risk; one study reported 30‐day readmission rates as high as 73% among patients with dementia and acute medical complications [6]. These readmissions often stem from potentially modifiable factors such as medication errors, inadequate discharge planning, or unmet caregiver needs [7]. Several clinical and sociodemographic factors have been implicated in readmission risk among individuals with dementia. Disease severity, often operationalized by dependence in activities of daily living, strongly predicts hospitalization and mortality risk [8]. Behavioral and psychological symptoms of dementia (BPSD), such as agitation, aggression, and psychosis, have also been linked to increased emergency service use and institutionalization [9, 10]. Moreover, polypharmacy and multimorbidity are common in this population; the use of five or more medications significantly increases the risk of adverse events, poor adherence, and hospital utilization [11]. Machine Learning in Healthcare Despite the clinical urgency, robust tools to predict rehospitalization in dementia remain limited. Traditional statistical models often fail to capture the nonlinear interactions between these multifactorial risks. Machine learning (ML) offers a promising solution by analyzing high‐dimensional data to identify complex, predictive patterns [12]. Although ML has been increasingly applied in healthcare and has demonstrated strong performance in predicting clinical outcomes, its application in dementia populations remains relatively limited in scope and clinical integration. Existing studies have largely focused on diagnostic classification or prediction of disease progression using neuroimaging or structured datasets, rather than clinically actionable outcomes such as rehospitalization. Furthermore, many ML models in dementia research rely on highly controlled datasets and lack external validation, limiting their generalizability to real‐world clinical settings. Therefore, there remains a need for studies that apply and systematically compare ML approaches in clinical cohorts, incorporating multidimensional predictors to improve prediction of longer‐term outcomes such as 1‐year rehospitalization [13]. Research Gap and Study Objectives To address this gap, we evaluate four ML algorithms—Random Forest (RF), Decision Tree (DT), Logistic Regression (LR), and Extreme Gradient Boosting (XGBoost), for predicting 1‐year rehospitalization in patients with dementia. Our objectives are: 1.To determine the optimal model for risk stratification.2.To identify the strongest predictors of readmission. 1.To determine the optimal model for risk stratification. To determine the optimal model for risk stratification. 2.To identify the strongest predictors of readmission. To identify the strongest predictors of readmission. Such models could ultimately support clinicians and health systems in targeting interventions to reduce avoidable readmissions in this vulnerable population. 2 Materials and Methods 2.1 Study Design and Setting This retrospective cohort study analyzed data from the hospital information system (HIS) of Rasoul Akram Hospital, a major academic center and referral hub for cognitive disorders in Tehran, Iran. The dataset included patients admitted to the psychiatry ward between January 1, 2016, and December 31, 2024. Reporting of this study followed the STROBE guideline for observational studies [14] and was additionally informed by TRIPOD and TRIPOD + AI recommendations [15] for the development and reporting of clinical prediction models using regression and ML methods. Ethical Approval and Informed Consent The study was approved by the Institutional Review Board of Iran University of Medical Sciences (IR.IUMS.REC.1403.635). Because of the retrospective design and use of anonymized data, the requirement for informed consent was waived. The study was conducted in accordance with the Declaration of Helsinki. Participants and Data Collection Patient Selection A total of 650 patient records with a primary or secondary diagnosis of dementia were initially identified from HIS. Inclusion criteria were: (1) age ≥ 18 years; (2) documented dementia/major neurocognitive disorder per Diagnostic and Statistical Manual of Mental Disorders (DSM) criteria by a psychiatrist/neurologist; (3) completed hospital stay; and (4) availability of key variables required for analysis. Patients were excluded if they were hospitalized for less than 1 day, discharged against medical advice, had incomplete medical records, or were admitted primarily for delirium without a confirmed diagnosis of dementia. Of the 650 records screened, 44 were excluded: 10 because the patients were discharged early against medical advice despite the treating physician's recommendation, and 34 because key clinical data were missing from the medical records. The detailed process of patient selection, including initial records and reasons for exclusion, is illustrated in Figure 1. Flow diagram of the patient selection process. Data Extraction A trained research assistant extracted data from the HIS using a standardized form. Ambiguities were resolved by cross‐referencing clinical notes or consulting senior staff, per institutional protocols. Variables and Outcome Measurement Predictor variables, informed by literature [5, 6, 7, 8, 16, 17, 18] and expert opinion, included: •Demographic: sex (binary), age (continuous). •Demographic: sex (binary), age (continuous). Demographic: sex (binary), age (continuous). •Clinical•Dementia subtype: (categorical: Alzheimer's, frontotemporal, vascular, Lewy body, Parkinson's, or mixed).•Severity: (categorical: mild, moderate, severe per DSM‐5 [1], based on daily functioning) •Clinical Clinical •Dementia subtype: (categorical: Alzheimer's, frontotemporal, vascular, Lewy body, Parkinson's, or mixed). Dementia subtype: (categorical: Alzheimer's, frontotemporal, vascular, Lewy body, Parkinson's, or mixed). •Severity: (categorical: mild, moderate, severe per DSM‐5 [1], based on daily functioning) Severity: (categorical: mild, moderate, severe per DSM‐5 [1], based on daily functioning) Dementia severity was classified as mild, moderate, or severe according to DSM‐5 criteria, based on the degree of functional impairment in Activities of Daily Living (ADLs) and Instrumental Activities of Daily Living (IADLs) as documented in the medical records. Functional status was not measured using a single standardized quantitative ADL/IADL instrument across all patients. Rather, severity classification reflected routine clinical assessment by the treating specialist psychiatrist, who integrated direct patient evaluation, clinical interview, and collateral information obtained from a caregiver or other knowledgeable informant. In routine specialist assessment, functional limitations that were clearly attributable to non‐dementia comorbidities, particularly physical or motor disorders, were not intended to be counted as functional impairment due to dementia when assigning the clinical severity stage. In this framework, patients were categorized as having mild dementia if they remained largely independent in basic ADLs and required at most limited assistance with more complex instrumental activities; moderate dementia if they required clear assistance with basic daily activities in addition to instrumental activities; and severe dementia if they were highly dependent in most or all basic ADLs. These severity classifications were recorded as part of standard clinical care and subsequently extracted from the hospital information system for the present study. ∘Behavioral disturbances: (binary: yes/no, clinically significant BPSD documented during admission requiring intervention). ∘Behavioral disturbances: (binary: yes/no, clinically significant BPSD documented during admission requiring intervention). Behavioral disturbances: (binary: yes/no, clinically significant BPSD documented during admission requiring intervention). ∘Medications: (continuous, total number of medications at index hospitalization). ∘Medications: (continuous, total number of medications at index hospitalization). Medications: (continuous, total number of medications at index hospitalization). ∘Medical comorbidities: (continuous, quantified using the Elixhauser comorbidity score). ∘Medical comorbidities: (continuous, quantified using the Elixhauser comorbidity score). Medical comorbidities: (continuous, quantified using the Elixhauser comorbidity score). ∘Psychiatric comorbidities: (binary: yes/no, ≥ 1 documented psychiatric comorbidity identified using DSM codes). ∘Psychiatric comorbidities: (binary: yes/no, ≥ 1 documented psychiatric comorbidity identified using DSM codes). Psychiatric comorbidities: (binary: yes/no, ≥ 1 documented psychiatric comorbidity identified using DSM codes). ∘Length of first hospitalization: (continuous, in days, calculated from admission to discharge). ∘Length of first hospitalization: (continuous, in days, calculated from admission to discharge). Length of first hospitalization: (continuous, in days, calculated from admission to discharge). ∘Outcome: unplanned rehospitalization within 365 days post‐discharge (binary: yes/no). ∘Outcome: unplanned rehospitalization within 365 days post‐discharge (binary: yes/no). Outcome: unplanned rehospitalization within 365 days post‐discharge (binary: yes/no). Data Preprocessing and Analysis Data were analyzed using Python 3.9 (Pandas, NumPy, Scikit‐learn, Matplotlib, imbalanced‐learn, XGBoost). Data Preparation Prior to model training, all categorical variables were transformed using One‐Hot Encoding to convert their textual representation into a numerical format suitable for ML algorithms. Numerical features were scaled using StandardScaler to normalize their ranges, preventing features with larger numerical values from disproportionately influencing model training. Patients were excluded if they had incomplete medical records affecting key study variables. Specifically, records were excluded when missing data involved essential predictors or the primary outcome variable (rehospitalization status), including dementia severity, behavioral disturbances, or core demographic information. Cases with only minimal or non‐critical missing data were retained. Given the relatively small proportion of excluded cases (~6.8%), a complete‐case analysis approach was adopted to ensure data consistency and avoid potential bias associated with inappropriate imputation. Although certain ML algorithms can accommodate missing data, many standard implementations require complete datasets or carefully applied imputation strategies, and improper handling of missingness may introduce systematic bias [19]. Class Balance, Oversampling, and Pipeline Integration The distribution of the target variable showed that 61.72% of patients were not rehospitalized (class 0), and 38.28% were hospitalized (class 1). To strictly prevent data leakage during model training, the Synthetic Minority Over‐Sampling Technique (SMOTE) and feature scaling (StandardScaler) were embedded within a machine learning Pipeline (using the imblearn library). During the fivefold cross‐validation process, these preprocessing steps were applied exclusively to the training folds of each iteration. This approach ensures that the validation folds remained completely unseen and unmanipulated by the resampling or scaling algorithms. Model Training and Hyperparameter Tuning The initial dataset was split into 70% training and 30% testing sets using stratified sampling to maintain class proportions. Four ML algorithms—Random Forest (RF), Decision Tree (DT), Logistic Regression (LR), and Extreme Gradient Boosting (XGBoost)—were implemented within the aforementioned pipeline to predict rehospitalization. For each model, hyperparameter tuning was performed using RandomizedSearchCV with fivefold stratified cross‐validation on the training set. Performance Metrics Performance on the unseen test was evaluated using several key metrics, including accuracy, precision, recall, F1‐score, confusion matrix, and the area under the receiver operating characteristic curve (AUC‐ROC). A confusion matrix was implicitly generated for these calculations. Feature Importance Analysis Feature importance was extracted from the trained models to identify the most influential predictors. For tree‐based models (RF, DT, XGBoost), importance was derived from gini impurity reduction or gain. For Logistic Regression, the absolute magnitude of coefficients was used as a proxy for feature contribution. Statistical Analysis Descriptive and inferential statistical analyses were performed to compare baseline characteristics between patients who were rehospitalized and those who were not rehospitalized. Continuous variables are reported as mean ± standard deviation (SD), and categorical variables as number (n) and percentage (%). Categorical variables were compared using Pearson's χ 2; Fisher's exact test was used when expected cell counts were small. Continuous variables were compared using the independent samples t‐test, reported with the t statistics and degrees of freedom (df). All statistical tests were two‐sided, and a p value < 0.05 was considered statistically significant a priori. No formal adjustment for multiple comparisons was applied because these baseline between‐group comparisons were conducted as descriptive, exploratory analyses intended to characterize the sample rather than test a pre‐specified causal hypothesis. By contrast, the pre‐specified primary analyses were ML model development and internal performance evaluation for prediction of 1‐year unplanned rehospitalization. No subgroup analyses were pre‐specified or performed. Model discrimination was assessed using accuracy, precision, recall, F1‐score, confusion matrix, and area under the receiver operating characteristic curve (AUC‐ROC). Five‐fold stratified cross‐validation was used during model training and hyperparameter tuning. Statistical reporting was aligned, where applicable, with SAMPL recommendations [20] and standard statistical texts [21, 22]. Data preprocessing and ML analyses were conducted in Python 3.9 using Pandas, NumPy, scikit‐learn, Matplotlib, imbalanced‐learn, and XGBoost. Results Sample Characteristics Of 650 patient records retrieved from the hospital information system, 606 were included in the final analysis. A total of 44 records were excluded, including 10 patients who were discharged early against medical advice despite the treating physician's recommendation and 34 patients with missing key clinical data in their medical records. Of these, 232 (38.3%) were readmitted within 1 year, and 374 (61.7%) were not. No significant differences were observed in age or sex. However, a statistically significant difference was found in the distribution of dementia subtypes (χ 2 p= 0.002). Analysis of adjusted standardized residuals revealed that vascular dementia was significantly associated with a higher likelihood of rehospitalization, showing a positive residual of +3.1 for the rehospitalized group. Conversely, mixed dementia exhibited a significant negative association with rehospitalization, indicating a lower propensity for readmission in this subtype (adjusted standardized residual = −3.1 in the rehospitalized group). Readmitted patients had higher rates of moderate to severe dementia (χ 2 p< 0.001), behavioral disturbances (p < 0.001), and psychiatric comorbidities (p < 0.001). The number of medications was significantly higher in the rehospitalized group than in the group that was not rehospitalized (p < 0.001). Medical comorbidity burden, measured using the Elixhauser score, was also significantly higher among readmitted patients (p < 0.001). Length of stay was significantly longer in the readmitted group (t‐test p= 0.003). Table 1 summarizes baseline characteristics by readmission status. Table 1Baseline characteristics of study patients by readmission status.CharacteristicReadmitted (n = 232)Not readmitted (n = 374)Total (n = 606)Statistical test p valueAge (years), mean ± SD69.9 ± 8.169.9 ± 10.369.9 ± 9.5 t‐test (t = 0.013, df = 604)0.990Sex, n (%)Chi‐square (χ 2 = 0.049, df = 1)0.825Male120 (51.7)190 (50.8)310 (51.2)Female112 (48.3)184 (49.2)296 (48.8)Subtype of dementia, n (%)Chi‐square (χ 2 = 18.454, df = 5)0.002a Alzheimer's disease88 (37.9)152 (40.6)240 (39.6)Frontotemporal dementia32 (13.8)50 (13.4)82 (13.5)Vascular dementia46 (19.8)40 (10.7)86 (14.2)Parkinson's disease dementia18 (7.8)18 (4.8)36 (5.9)Lewy body dementia20 (8.6)32 (8.6)52 (8.6)Mixed dementia28 (12.1)82 (21.9)110 (18.2)Severity of dementia, n (%)Chi‐square (χ 2 = 81.993, df = 2)< 0.001a Mild80(34.5)236 (63.1)316 (52.1)Moderate110 (47.4)134 (35.8)244 (40.3)Severe42 (18.1)4 (1.1)46 (7.6)Behavioral disturbance, n (%)Chi‐square (χ 2 = 207.08, df = 1)< 0.001Yes204 (87.9)104 (27.8)308 (50.8)No28 (12.1)270 (72.2)298 (49.2)Number of medications, mean ± SD5.3 ± 5.51.5 ± 1.73.0 ± 4.1 t‐test(t = 12.337, df = 604)< 0.001Medical comorbidity score, mean ± SD3.3 ± 4.20.2 ± 1.11.4 ± 3.1 t‐test(t = 13.322, df = 604)< 0.001Psychiatric comorbidities, n (%)Chi‐square (χ 2 = 95.93, df = 1)< 0.001Yes168 (72.4)118 (31.6)286 (47.2)No64 (27.6)256 (68.4)320 (52.8)Length of stay (days), mean ± SD22.4 ± 10.919.7 ± 10.720.69 ± 10.79 t‐test (t = −3.01, df = 604)0.003 Note: For multi‐category variables, the p value denoted by (a) represents the overall χ 2 test. p values < 0.05 indicate statistical significance. Percentages may not sum to 100% due to rounding.John Wiley & Sons, Ltd. Baseline characteristics of study patients by readmission status. Note: For multi‐category variables, the p value denoted by (a) represents the overall χ 2 test. p values < 0.05 indicate statistical significance. Percentages may not sum to 100% due to rounding. Predictive Model Performance All implemented ML models demonstrated strong predictive performance for 1‐year rehospitalization, with AUC‐ROC values ranging from 0.964 to 0.986 (Table 2). Random Forest achieved the best overall performance, with a test accuracy of 0.929 and the highest AUC‐ROC of 0.986. XGBoost also performed strongly, with a test accuracy of 0.918 and an AUC‐ROC of 0.982. LR and DT showed competitive results, with test accuracies of 0.896 and 0.890 and AUC‐ROC values of 0.964 and 0.965, respectively. The balanced F1‐scores further indicate robust performance across both classes. Cross‐validated AUC values during hyperparameter tuning were also high, ranging from 0.959 to 0.992, indicating good internal generalization. Table 2Performance metrics of machine learning algorithms.AlgorithmBest CV AUCTest accuracyPrecision (class 1)Precision (class 0)Recall (class 1)Recall (class 0)F1‐score (class 1)F1‐score (class 0)Test AUC‐ROCRF0.9760.9290.8700.9710.9570.9110.9120.9400.986DT0.9440.8900.8470.9180.8710.9020.8590.9100.965LR0.9480.8960.8400.9350.9000.8930.8690.9130.959XGBoost0.9750.9180.8670.9530.9290.9110.8970.9320.982 Note: Best CV AUC represents the highest mean area under the receiver operating characteristic curve obtained during fivefold stratified cross‐validation on the training set. Class 1: readmitted within 1 year; Class 0: not readmitted. Precision: correct positive predictions; recall: actual positives identified; F1‐score: harmonic mean of precision and recall.Abbreviations: DT, decision tree; LR, logistic regression; RF, random forest; XGBoost, extreme gradient boosting.John Wiley & Sons, Ltd. Performance metrics of machine learning algorithms. Note: Best CV AUC represents the highest mean area under the receiver operating characteristic curve obtained during fivefold stratified cross‐validation on the training set. Class 1: readmitted within 1 year; Class 0: not readmitted. Precision: correct positive predictions; recall: actual positives identified; F1‐score: harmonic mean of precision and recall. Abbreviations: DT, decision tree; LR, logistic regression; RF, random forest; XGBoost, extreme gradient boosting. AUC‐ROC Curves The receiver operating characteristic (ROC) curves for each model, illustrating their ability to distinguish between rehospitalized and not rehospitalized patients, are presented in Figures 2, 3, 4, 5. The high AUC values observed across all models underscore their strong discriminative power. Receiver operating characteristic curve for XGBoost. Receiver operating characteristic curve for Random Forest. Receiver operating characteristic curve for Decision Tree. Receiver operating characteristic curve for Logistic Regression. Feature Importance Analysis of feature importance across the models revealed key predictors of 1‐year rehospitalization (Table 3). For tree‐based models (RF, DT, XGBoost), feature importance indicates the relative contribution of each feature to prediction. For LR, the absolute magnitude of coefficients reflects feature impact on log‐odds of rehospitalization. Table 3Feature importance scores (Gini for RF/DT, coefficients for LR, gain for XGBoost).FeatureRFDTLRXGBoostAge0.05790.01420.38430.0106SexMale0.01070.00000.31230.0071Female0.01070.00160.14180.0086Dementia subtypeMixed0.01210.01110.06310.0121Vascular0.00850.00760.24400.0077Frontotemporal dementia0.00520.00000.08460.0086Parkinson's disease dementia0.00400.00000.13230.0067Alzheimer0.01310.00000.27890.0087Lewy body0.00560.00000.07250.0075Dementia severitySevere0.03300.07772.23400.0625Moderate0.01650.01700.74910.0149Mild0.03350.00651.31450.0126Behavioral disturbanceYes0.15160.49181.74040.2647No0.16770.00001.56990.2622Number of medications and polypharmacy0.17650.24250.87730.1339Psychiatric comorbiditiesYes0.05710.07231.04540.0379No0.06330.00000.87500.0465Medical comorbidity score0.11060.02351.67890.0757Length of the first hospitalization0.06240.03420.00880.0114 Note: Importance scores reflect feature contribution to model predictions: Gini importance (RF, DT; range 0–1, higher values indicate greater contribution to node purity/gain); absolute coefficients (LR; log odds ratio). Scores are model‐specific and not directly comparable across algorithms. A value of 0.0000 may indicate minimal contribution or that the feature was not selected by the model for splitting/prediction.Abbreviations: DT, decision tree; LR, logistic regression; RF, random forest; XGBoost, extreme gradient boosting.John Wiley & Sons, Ltd. Feature importance scores (Gini for RF/DT, coefficients for LR, gain for XGBoost). Note: Importance scores reflect feature contribution to model predictions: Gini importance (RF, DT; range 0–1, higher values indicate greater contribution to node purity/gain); absolute coefficients (LR; log odds ratio). Scores are model‐specific and not directly comparable across algorithms. A value of 0.0000 may indicate minimal contribution or that the feature was not selected by the model for splitting/prediction. Abbreviations: DT, decision tree; LR, logistic regression; RF, random forest; XGBoost, extreme gradient boosting. Feature‐importance analysis across models showed that severe dementia and behavioral disturbance were among the most influential predictors of 1‐year rehospitalization. Polypharmacy and medical comorbidity burden, quantified using the Elixhauser score, also contributed substantially across several models. Psychiatric comorbidity remained an important predictor, whereas age, sex, length of stay, and dementia subtype generally showed smaller contributions. Discussion This study aimed to predict 1‐year rehospitalization in 606 patients with dementia, an area with significant implications for patient outcomes and healthcare utilization. ML models demonstrated robust performance, with RF achieving the highest AUC‐ROC (0.986) and the highest test accuracy (0.929). XGBoost also yielded strong performance, with a test accuracy of 0.918 and an AUC‐ROC of 0.982. DT and LR also demonstrated strong performance, with test accuracies of 0.890 and 0.896 and AUC‐ROC values of 0.965 and 0.964, respectively. Feature importance analysis identified severe dementia and the presence of behavioral disturbances as the primary predictors of rehospitalization across models, followed by psychiatric comorbidities, polypharmacy, and medical comorbidity burden, while variables such as age, sex, and length of stay showed comparatively lower predictive value. The prominence of behavioral disturbances aligns with extensive evidence highlighting their role in healthcare utilization. Consistent with other studies, hospitalized patients with dementia who exhibited agitation, aggression, wandering, or psychosis were more likely to be readmitted [6]. Ma et al. reported that patients with dementia who exhibited behavioral issues had a 2.5‐fold higher risk of readmission within 6 months [17]. The challenges caregivers face in managing behavioral symptoms often precipitate acute care visits, suggesting that interventions like caregiver training or non‐pharmacological strategies could mitigate readmissions [23]. Our findings, which indicate behavioral disturbance as a top predictor with high importance across all models, strongly corroborate these observations. The variable labeled dementia severity in our study, which was based on DSM‐5 functional staging using dependence in Activities of Daily Living (ADLs) and Instrumental Activities of Daily Living (IADLs), also emerged as a key predictor of rehospitalization, aligning with studies that associate poor daily functioning with adverse outcomes [24, 25, 26]. In routine clinical practice, the treating specialist psychiatrist considers whether functional impairment is plausibly attributable to dementia rather than to other medical, neurological, motor, or physical comorbidities when assigning this severity stage. However, because standardized cognitive measures were not available in the present study, and because residual confounding by noncognitive contributors to disability cannot be excluded, this variable should still be interpreted primarily as a clinician‐assigned functional severity measure rather than a direct measure of cognitive severity. Therefore, our findings support the predictive relevance of functional impairment in this cohort, but they do not allow conclusions about whether functional status is more important than cognitive impairment for rehospitalization risk. Psychiatric comorbidities, such as depression and anxiety, also emerged as significant predictors of rehospitalization in our study. Ma et al. [17] reported a 1.58‐fold increase in readmission odds among dementia patients and comorbid depression (95% CI: 1.06–2.35) [17]. Likewise, a retrospective cohort study found that individuals with dementia and psychiatric comorbidities had significantly higher utilization of both inpatient and outpatient services [27]. These conditions may amplify cognitive and emotional challenges, leading to more frequent hospital visits. Polypharmacy was a key predictor in our study. Consistent with prior research, Mueller et al. [28] found increased hospitalization hazards with polypharmacy (HR: 1.12 for 4–6 medications, 1.32 for ≥ 7 medications) [28]. Moreover, Talukdar et al. [29] reported that polypharmacy increased the odds of potentially inappropriate medication (PIM) by 2.93 times, linked to higher hospitalization rates [29]. These findings underscore the need for careful medication review and deprescribing strategies to mitigate rehospitalization risk. Medical comorbidity burden also showed meaningful predictive impact in the analysis. This finding likely reflects the use of the Elixhauser comorbidity score, which provides a more detailed representation of overall medical burden than a simple presence/absence indicator. Consistent with our findings, other studies report high comorbidity rates in patients with dementia (e.g., 91.3%), suggesting their influence on readmission can be mediated by factors like functional decline or behavioral symptoms [30]. In our analysis, the use of a continuous comorbidity score may have better captured these differences across patients and improved the contribution of medical burden to model prediction. The RF model's strong performance (AUC‐ROC 0.986, test accuracy 0.929) and XGBoost's similarly high performance (AUC‐ROC 0.982, test accuracy 0.918) compare favorably to related studies in healthcare prediction. For instance, in predicting readmission risk for elderly patients with coronary heart disease, Luo et al. [31] found that XGBoost demonstrated the most accurate performance among several ML techniques, achieving an AUC of 0.891 on an external validation dataset. While RF was also evaluated in their study, XGBoost was identified as superior for that particular task [31]. In the context of hospitalization prediction for older adults, an RF model achieved an AUC of 0.834, further demonstrating RF's utility in geriatric populations [32]. Regarding long‐stay nursing home residents with Alzheimer's disease and related dementias, Xu et al. [33] reported that XGBoost slightly outperformed LR in predicting hospitalizations (AUC 0.878 vs. 0.857) and emergency department visits (AUC 0.849 vs. 0.830), with risk‐adjusted rates being highly correlated between methods [33]. Furthermore, for predicting delirium risk in hospitalized older patients with dementia, both RF (AUC 0.959) and XGBoost (AUC 0.967) showed excellent performance, although XGBoost exhibited a marginal advantage [34]. The ensemble models' inherent ability to handle non‐linear relationships and their robustness make them well‐suited for heterogeneous datasets, such as those encountered in the current study, where behavioral disturbances consistently ranked as a top predictor across models, enhancing confidence in their clinical relevance. However, it is important to note that RF performance can vary across different datasets and prediction tasks, with some studies reporting lower AUCs for general readmission prediction (e.g., 0.60–0.78) [35, 36]. Conclusion This study demonstrates the robust predictive capabilities of ensemble ML models, particularly RF and XGBoost, in identifying 1‐year rehospitalization risk among patients with dementia. Our RF model achieved the strongest predictive performance (AUC‐ROC 0.986; test accuracy 0.929), while XGBoost also showed excellent performance (test accuracy 0.918, AUC‐ROC 0.982), both of which compare favorably with similar predictive efforts in diverse patient populations. The capacity of these ensemble models to handle non‐linear relationships and provide feature importance offers actionable clinical insights beyond a mere risk score, facilitating targeted and personalized care strategies. Across models, behavioral disturbances, dementia severity, polypharmacy, medical comorbidity burden, and psychiatric comorbidity emerged as important predictors of rehospitalization, underscoring their potential relevance for early risk stratification and intervention planning. Limitations Several limitations should be acknowledged. First, this was a single‐center retrospective study conducted at an academic hospital in Tehran, Iran, which may limit generalizability to other settings and populations. Second, the moderate sample size (n = 606) and exclusion of patients with missing key variables may have introduced selection bias and limited the ability to detect fewer common predictors. In addition, several potentially relevant factors, such as caregiver burden, social support, specific medication classes, housing status, and insurance coverage, were not available for analysis. Another important limitation is that the variable labeled dementia severity was based on clinician‐assigned functional staging rather than standardized cognitive testing. Although routine specialist assessment attempts to distinguish dementia‐related functional decline from disability primarily attributable to other comorbidities, particularly motor or physical disorders, this distinction may not have been fully captured in all retrospectively reviewed records. Therefore, this variable may partly reflect noncognitive contributors to disability. Although overall medical comorbidity burden was included using the Elixhauser score, specific conditions that may disproportionately affect functional status, such as prior stroke, were not analyzed separately. Accordingly, our findings should be interpreted as reflecting the association of rehospitalization with functional severity in patients with dementia rather than with cognitive severity alone. Furthermore, while our models demonstrated strong discriminative ability—evidenced by high AUC‐ROC, accuracy, and F1‐scores—we did not assess calibration metrics (e.g., Brier score or calibration curves). Assessing calibration is critical for understanding the absolute predicted risk and evaluating how closely the predicted probabilities align with the actual observed rehospitalization rates. Future studies should prioritize rigorous calibration evaluations to fully determine the clinical utility of these predictive models. Future Directions Future research should focus on external validation and prospective testing of these models in diverse, multi‐center settings to assess their generalizability and clinical utility. Including additional socio‐economic, caregiver‐related, and clinical variables may improve model performance and interpretability. Larger longitudinal datasets may also support refinement of predictors and evaluation of more advanced machine learning approaches. Author Contributions Amirreza Esmaeili: conceptualization, data curation, formal analysis, writing – review and editing, writing – original draft. Vahid Saeedi: conceptualization, data curation, formal analysis, investigation. Leila Kamalzadeh: writing – original draft, writing – review and editing, conceptualization, methodology, supervision, formal analysis. Funding The authors have nothing to report. Conflicts of Interest The authors declare no conflicts of interest. Transparency Statement Leila Kamalzadeh affirms that this manuscript is an honest, accurate, and transparent account of the study being reported; that no important aspects of the study have been omitted; and that any discrepancies from the study as planned have been explained.