Introduction

Maintenance Hemodialysis (MHD) is a widely employed therapeutic approach for individuals with end-stage renal disease. However, MHD itself introduces a range of complications that predispose patients to cognitive impairment. As the treatment duration extends, patients may also experience anemia, malnutrition, and muscle atrophy, culminating in increased frailty1.

Cognitive Frailty (CF) is a syndrome defined by the coexistence of physical frailty and mild cognitive impairment, while excluding Alzheimer’s disease and other forms of dementia2. Research has demonstrated a high prevalence of cognitive frailty3, with affected patients being more prone to adverse outcomes such as falls, disability, and mortality4,5, which can significantly diminish quality of life.

Risk prediction models can assist healthcare professionals in the early identification of high-risk populations. Currently, CF risk prediction models for elderly patients undergoing MHD are insufficient, with the selection of influencing factors lacking comprehensiveness, and most existing models relying on traditional logistic regression algorithms. In light of this, the present study further investigates the influencing factors of CF in elderly patients with MHD through a cross-sectional survey and it employs five machine learning algorithms (Support Vector Machine, Extreme Gradient Boosting, Random Forest, Neural Networks, Logistic regression) to develop risk prediction models. The above five models are used as base classifiers, and 16 integrated models with different combinations of base classifiers are constructed based on the Stacking method. The optimal integrated models are selected and compared with the five single models, the optimal predictive models are screened and externally validated, and the optimal models are deployed on the web page through the Streamlit library, a move aimed at providing healthcare professionals with a tool for early prediction of CF risk in elderly patients with MHD.

Objects and methods

Subjects

A convenience sampling method was employed to select 1,075 elderly patients undergoing MHD from October 2023 to March 2024 across several tertiary hospitals in Chengdu, as well as 269 elderly patients from September 2024 to October 2024 in various hospitals in Chengdu, Yibin, and Zigong for the study. Inclusion criteria consisted of: age ≥ 60 years; duration of maintenance hemodialysis treatment ≥ 3 months; demonstrated routine communication abilities and provided informed consent. Exclusion criteria included: patients diagnosed with dementia; individuals with intellectual disabilities or a history of psychiatric disorders; severe visual or auditory impairments that hindered cooperation in completing the questionnaire and assessments; individuals unable to undergo evaluations of frailty and cognitive impairment due to functional limitations (e.g., arriving at the hospital for dialysis in a wheelchair or being bedridden); and patients experiencing acute kidney injury or having undergone renal transplantation within the preceding 3 months.

Methods

CF judging criteria

Referring to the latest international consensus2, the patients had undiagnosed clinical dementia; a score of 3 or more on the Frailty Phenotype Scale (FP); and a score of 18 to 25 on the Montreal Cognitive Assessment (MOCA).

Research tools

General information questionnaire

Developed by the principal investigator of this study after a review of previous research, this questionnaire encompasses patients’ socio-demographic information (age, sex, marital status, education level, mode of residence, medical payment method for medical care), physical indicators (height, weight, BMI), lifestyle and behavioral habits (smoking history, alcohol consumption, and exercise), disease-related information (comorbidities, history of falls within 1 year, months on dialysis, and dialysis vascular access), as well as laboratory indicators (hemoglobin, C-reactive protein, serum albumin, serum calcium, serum phosphorus, parathyroid hormone, total cholesterol, triglycerides, serum sodium, blood urea nitrogen, serum creatinine, and glomerular filtration rate).

Fried’s Frailty phenotype scale (FP)

The scale, proposed by Fried in 20016, comprises five assessments: decreased body mass, self-reported fatigue, diminished grip strength, reduced gait speed, and low levels of physical activity. The scale has a total score range of 5 points, with the following scoring criteria: 0 indicates non-debilitating status, 1–2 indicates pre-debilitating status, and ≥ 3 indicates debilitating status. It has been extensively utilized within the chronic kidney disease population, demonstrating a content validity coefficient of 0.98 and a Cronbach’s alpha coefficient of 0.93.

Montreal Cognitive Assessment Scale (MOCA)

The Chinese version of the Montreal Cognitive Assessment (MOCA) was utilized7, translated and modified by Wang Wei and colleagues in 2006 to reflect the cultural characteristics of our country. It primarily assesses cognitive function across seven domains, including visuospatial and executive functions, naming, and attention, with a maximum score of 30. Higher scores indicate better cognitive performance, with a score of ≥ 26 on the MOCA considered indicative of normal cognitive function2. The MOCA demonstrates high test-retest reliability (0.9 or above), internal consistency (Cronbach’s alpha = 0.83), and positive and negative predictive values.

Pittsburgh sleep quality index (PSQI) scale

The Pittsburgh Sleep Quality Index (PSQI), compiled by Buysse et al.8, was utilized. This scale consists of 19 self-assessed items and five other-assessed items, with the 18 self-assessed items organized into seven components: subjective sleep quality, time taken to fall asleep, sleep duration, sleep efficiency, sleep disturbances, use of hypnotic medication, and daytime dysfunction. Each component is scored from 0 to 3, and the total score is the summation of the 7 component scores, resulting in a range from 0 to 21. A PSQI score greater than 7 indicates the presence of sleep problems. The scale exhibits a Cronbach’s alpha coefficient of 0.7962, demonstrating good reliability and validity.

Malnutrition-inflammation score (MIS)

The Malnutrition Inflammation Score (MIS)9 includes ten evaluation indicators, each scored from 0 (normal) to 3 (malnutrition), resulting in a total score range of 0 to 30 points. A score of 0–8 indicates mild malnutrition, 9–18 indicates moderate malnutrition, and a score more excellent than 18 indicates severe malnutrition. The score increases with the severity of malnutrition and inflammation. The scale demonstrates a Cronbach’s alpha coefficient of 0.866.

Geriatric depression scale (GDS-15)

The scale, developed by Sheikh10, comprised 15 items to which respondents replied with “yes” or “no.” Each “yes” was assigned a score of 1 point, while each “no” received a score of 0 points, with a threshold of ≥ 8 points indicating the presence of depressive symptoms. Scores ranged from 0 to 15, reflecting the severity of depressive symptoms, with higher scores correlating to more severe symptoms. The scale primarily assesses respondents’ depressive status over the preceding week. The Cronbach’s alpha coefficient for the scale was 0.793, and the test-retest reliability was 0.728.

Social Support Rating Scale (SSRS)

The scale11, developed by Chinese scholar Xiao Shuiyuan, encompasses three dimensions: objective support, subjective support, and utilization of social support, comprising a total of 10 items. The overall score ranges from 12 to 66 points, with higher scores indicative of greater social support; expressly, scores of ≤ 22 reflect a low level, 23–44 indicate a medium level, and ≥ 45 signify a high level of social support. The internal consistency, measured by Cronbach’s alpha coefficient, ranges from 0.825 to 0.896, demonstrating robust reliability and validity, making it suitable for social support research in China.

Survey methods

All investigators received standardized training, with uniform guidelines provided, and were required to use the same brand and model of measurement tools. Surveys were conducted with patients who voluntarily participated in the study, ensuring that they had a thorough understanding of the research. Data collection utilized standardized paper questionnaires, which were distributed and collected on-site. When patients’ conditions permitted, they completed the questionnaires independently; however, if patients could not to fill them out due to physical disabilities, reading difficulties, dialysis, or other reasons, the researcher meticulously inquired and accurately recorded responses item by item. Throughout the questionnaire completion process, the researcher clarified any items that the subjects did not understand, while refraining from influencing their selection of answers.

Statistical analysis

Continuous variables were expressed as mean ± standard deviation, and comparisons between two groups were conducted using an independent samples t-test. Categorical variables were presented as n (%) and comparisons between groups were performed using the chi-square test. Missing values were imputed using the MICE package in R Studio version 4.3.1. Binary logistic regression, including both univariate and multivariate analyses, was employed to identify factors influencing CF in elderly patients undergoing MHD, with factors exhibiting P < 0.2 considered for subsequent model construction.

This study included a total of 1,075 modeling samples, with the outcome variables being dichotomous and the predictor variables comprising dichotomous, multichotomous, and continuous variables. Five machine learning algorithms—SVM, XGBoost, RF, NN, and LR—were utilized to construct the model. The train_test_split function in Python 3.10 was employed to divide the dataset into a training set and a test set at a 75:25 ratio. Additionally, 269 patients from other hospitals were included as an external validation set.

The predictor variables underwent one-hot encoding and standardization, while 5-fold cross-validation and grid search were utilized for model training and hyperparameter optimization. The five aforementioned models were employed as base classifiers, and an integrated model was constructed using the Stacking method. This method leverages a hierarchical integration strategy, where the prediction outputs of the base classifiers are input into the meta-classifier to generate the final predictions. In this study, XGBoost was selected as the meta-classifier due to its outstanding nonlinear fitting capability and computational efficiency. Each base classifier utilized the optimal hyperparameter settings determined through grid search optimization during its individual model construction. Integration was achieved using the StackingClassifier, which combines the prediction outputs of the base classifiers with the original feature inputs for learning by the meta-classifier. Various combinations of three to five base classifiers were generated using a combinatorial approach, and the AUC, accuracy, recall, precision, and F1 score of each combination were evaluated. The optimal integrated model was selected by comparing the AUC of each combination.

The optimal integrated model was compared with five individual models, and the performance of all these models was evaluated using AUC, accuracy, recall, precision, and F1 score. The 95% confidence intervals were calculated using the Bootstrap method, while decision curves and calibration curves were employed to assess the clinical applicability and calibration of the models. The model with the highest AUC was ultimately selected as the best model, and its generalization performance was validated using an external validation set.

Results

Characterization of the study sample

Among the 1,075 elderly patients with MHD, there were 153 patients with CF and 922 without CF, resulting in a CF prevalence of 14.2%. Differences in characteristics between the two groups are detailed in Table 1. Compared to non-CF patients with MHD, those with CF were older (mean age 73.8 ± 7.6 years), more likely to live alone or in a nursing facility, often had residential health insurance or New Rural Cooperative Medical Insurance, did not engage in exercise, regularly consumed alcohol, had long-term central venous cannulas, exhibited lower serum albumin and serum phosphorus levels, presented with abnormal total cholesterol levels, had higher blood urea nitrogen, and experienced more severe malnutrition and depression.

Results of unifactorial and multifactorial analysis

After conducting univariate and multivariate logistic regression analyses, the final results indicated that there were no statistically significant differences between the two groups of patients concerning sex, marital status, education level, smoking history, weight, height, BMI, months on dialysis, comorbidities, history of falls within 1 year, hemoglobin, hemoglobin classification, ultrasensitive c-reactive protein, ultrasensitive c-reactive protein classification, serum albumin, serum calcium, serum calcium classification, serum phosphorus, serum sodium, serum sodium classification, parathyroid hormone, parathyroid hormone classification, total cholesterol, triglycerides, triglyceride classification, blood urea nitrogen, serum creatinine, serum creatinine classification, glomerular filtration rate, glomerular filtration rate classification, PSQI, degree of malnutrition, and social support score (P > 0.2) (Supplementary Table 1). However, significant differences (P < 0.2) were observed between the two groups in terms of age, mode of residence, medical payment method, exercise, alcohol consumption, dialysis vascular access, serum albumin classification, serum phosphorus classification, total cholesterol classification, blood urea nitrogen classification, malnutrition score, depression score(Table 1).

Table 1 Descriptive statistics for variables (P<0.2).

For comprehensive descriptive analysis, odds ratios (ORs) for each predictor variable were examined through univariate and multivariate logistic regression (refer to Table 1). The study revealed that advanced age, solitary living, residence in nursing facilities, regular alcohol consumption, prolonged central venous catheterization, low serum albumin levels, elevated blood urea nitrogen, abnormal total cholesterol, malnutrition, and depression were identified as risk factors for CF in elderly patients undergoing MHD. (OR 1.08, 95% CI 1.04–1.11, OR 8.28, 95% CI 4.85–14.14, OR 26.59, and 95%CI 2.04-346.46, OR 11.24, 95%CI 1.83–68.97, OR 1.92, 95%CI 1.16–3.18, OR 1.91, 95%CI 1.17–3.11, OR 2.90, 95%CI 1.21–6.97, OR 1.43, 95%CI 0.88–2.32, OR 2.90, 95% CI 1.21–6.97, OR 1.43, 95% CI 0.88–2.32, OR 1.04, 95% CI 0.99–1.10, OR 1.10, 95% CI 1.04–1.16); Elderly patients with MHD enrolled in resident health insurance and the New Rural Cooperative Medical Insurance exhibited a higher risk of CF compared to those enrolled in employee health insurance (OR 2.04, 95% CI 1.28–3.25; OR 14.62, 95% CI 6.77–31.58). Moreover, elderly patients with MHD who engaged in occasional or frequent exercise demonstrated a lower risk of CF compared to those who never exercised (OR 0.41, 95% CI 0.24–0.72; OR 0.57, 95% CI 0.32–1.03). Additionally, elderly patients with MHD exhibiting elevated serum phosphorus levels had a reduced risk of CF in comparison to patients with low or normal serum phosphorus levels (OR 0.72, 95% CI 0.45–1.14).

Comparison of stacking models with varying combinations of base classifiers

By constructing Stacking integrated learning models with different combinations of base classifiers, we compare the performance variations across these models. Table 2 presents the Stacking integrated models with 3, 4, and 5 base classifiers, respectively. The combination “RF + LR + NNET” demonstrates the best performance among all base classifier combinations, with an AUC of 0.911, accuracy of 0.903, precision of 0.912, recall of 0.983, and an F1 score of 0.946. Therefore, the Stacking integration model composed of “RF + LR + NNET” is selected as the optimal integrated model.

Table 2 Evaluation indicators of different stacking models.

Comparison of machine learning algorithm prediction performance

Figure 1 shows the predictive efficacy of the Stacking model and the five single models on the test set in the form of ROC curves.The Stacking model is, the Stacking integrated model with the best predictive performance in Section “Comparison of Stacking models with varying combinations of base classifiers”. The Stacking model (AUC = 0.911) was the best predictor of the occurrence of CF in patients with MHD, followed by XGBoost ( AUC = 0.896), SVM (AUC = 0.87), NNET (AUC = 0.866), LR (AUC = 0.858) and RF (AUC = 0.844) models.

Fig. 1
figure 1

ROC curves for the test set of six models.

Table 3 presents a detailed set of performance metrics for the Stacking model and five individual models in both the training and test sets. In the test set, the Stacking model achieved the highest accuracy and F1 score, with values of 0.903 and 0.946, respectively. The LR model exhibited the highest precision, with a value of 0.974, while the RF model demonstrated the highest recall, with a value of 0.996.

Table 3 Performance metrics of the models on the training and test set.

Figure 2 presents the DCA curves for the test set. The results of the DCA analysis demonstrate that the Stacking model offers the greatest net clinical benefit across the range of threshold probabilities compared to the other models, suggesting that the Stacking model is the optimal model with significant clinical utility.

Fig. 2
figure 2

DCA curves for the test set of six models.

Figure 3 shows the calibration curves for the Stacking model and the five single models. The calibration curves have a high degree of linear overlap with y = x, and the models are in good agreement between the predicted and actual occurrence risk values.

Fig. 3
figure 3

Calibration curves for the test set of six models.

Sensitivity analysis of model parameters

The “max_depth” parameter controls the maximum depth of the tree in the RF model, and various depths ranging from 3 to 27 were tested. As shown in Fig. 4a, the model’s AUC reaches its highest value at a maximum depth of 3. The “hidden_layer_sizes” parameter governs the size of the hidden layers in the NNET model, with sizes ranging from 10 to 100 tested, as shown in Fig. 4b. The model’s AUC reaches its highest value when the hidden layer size is 80. The “kernel” parameter controls the kernel function type in the SVM model, with “rbf,” “linear,” “poly,” and “sigmoid” kernel types tested. As depicted in Fig. 4c, the model’s AUC reaches its highest value when the kernel function type is “sigmoid.”

Fig. 4
figure 4

Model parameter tuning curves. (a) Max depth configurations, (b) Hidden layer configurations, (c) Kernel configurations.

External validation

We validated the Stacking model (AUC = 0.832) using an external validation set consisting of 269 patients from other hospitals (Fig. 5a). The DCA curves (Fig. 5b) and calibration curves (Fig. 5c) for the model on the external validation set demonstrated its excellent clinical utility and calibration. Consequently, we concluded that the Stacking model can accurately predict CF in elderly patients with MHD.

Fig. 5
figure 5

ROC curve (a), DCA curve (b), and calibration curve (c) of the Stacking model on the external validation set.

Deployment of models on web platforms

The Stacking model’s web page deployment and prediction result visualization were implemented using the Streamlit library.Upon logging into the webpage via the local area network (LAN), users are prompted to input the relevant index data, followed by clicking the prediction button to initiate the forecasting process. The fundamental web interface of the model is depicted in Fig. 6.

Fig. 6
figure 6

Display of the web prediction interface.

Discussion

Analysis of variables related to CF risk in elderly patients with MHD

Age

This study demonstrated that age is a significant risk factor for CF in elderly patients undergoing MHD. Consistent with previous research12,13, age correlates with an increased risk of CF in MHD patients. As patients age, their physiological functions progressively decline, muscle strength in the limbs diminishes, the rate of cerebral white matter atrophy accelerates, and overall organismal weakening intensifies, thereby augmenting the likelihood of developing CF.

Mode of residence

Compared to living alone, cohabiting with family members not only increases opportunities for older individuals to engage in social activities but also broadens their external social network, exposing them to more impactful information. In a familial setting, older adults can better share experiences and insights with family members, a process less prevalent in healthcare facilities. This interaction fosters cognitive enrichment and supports the maintenance of healthy behaviors. Moreover, family interactions offer emotional support and strengthen social connections. Therefore, residing with family members positively influences the overall health and well-being of older adults, thereby mitigating the risk of CF14.

Medical payment method

Compared to employee health insurance, the risk of CF occurrence was higher in the resident health insurance and new rural medical cooperative health insurance groups, aligning with national studies15. Older adults covered by employee health insurance benefit from higher reimbursement rates and more reliable access to healthcare services. In contrast, those under resident health insurance or the new rural medical cooperative health insurance are more likely to face a more significant financial burden in managing disease-related expenses and other healthcare needs.

Exercise

The study by Scholar Tingting Jiang16 indicated that physical activity was a significant factor influencing the occurrence of CF in MHD patients. Liu et al.17 observed that exercise could mitigate the risk of CF in these patients. This may be attributed to the positive effects of exercise on cerebral blood flow and oxygen supply, which enhance cerebral circulation and improve cognitive function. Additionally, exercise can increase muscle fiber size or quantity, reduce skeletal muscle cell apoptosis, and improve motor function, thereby lowering the incidence of CF. These findings suggest that healthcare professionals should pay increased attention to elderly MHD patients who engage in limited physical activity and implement targeted exercise interventions.

Alcohol consumption

It has been observed that alcohol consumption affects cognitive function18. Chronic alcohol intake may result in neuronal damage and cause central nervous system depression, manifesting as reduced sensory perception, prolonged reaction times, memory impairment, diminished motor function, and impaired judgment19. Consequently, alcohol consumption is regarded as a critical influencing factor for CF and should be incorporated into the care plan for elderly patients undergoing MHD.

Dialysis vascular access

In this study, we found that elderly MHD patients with long-term central venous cannulation had a higher risk of CF than those using autologous arteriovenous endovascular fistulae or artificially vascularized arteriovenous endovascular fistulae. A foreign survey on the prevalence of debilitation and cognitive dysfunction in MHD patients revealed that complications related to vascular access contributed to an increased prevalence among the elderly20. A domestic study showed that MHD patients with permanent vascular access were less prone to debilitation. This may be attributed to the prevention of frailty associated with repeated vascular punctures and the durable and reliable structure of permanent vascular access, which also facilitates adequate dialysate flow, ensuring effective dialysis and the maintenance of overall health21. Therefore, healthcare professionals should closely monitor MHD patients with long-term central venous catheterization, providing meticulous catheter care and vascular protection to minimize repeated punctures, reduce vascular injury, and maintain the proper function of the access.

Serum albumin

Studies have shown12,16,22 that low serum albumin levels are a risk factor for CF in elderly MHD patients. As dialysis duration increases, patients typically exhibit signs of malnutrition, which is reflected internally by a decline in serum albumin levels. Serum albumin levels serve as an indicator of nutritional status, and optimal nutritional status can help mitigate the systemic inflammatory response and delay the deterioration of vital organs such as the heart and brain23. Therefore, healthcare professionals should routinely screen for malnutrition and identify at-risk patients to minimize the occurrence of CF.

Serum phosphorus

National studies have indicated that22 MHD patients with lower blood phosphorus levels are at a higher risk of CF. Disorders in calcium and phosphorus metabolism, coupled with dietary restrictions, lead to diminished protein synthesis; prolonged inactivity further exacerbates the reduction in muscle mass and strength. Consequently, patients are more prone to experiencing decreased grip strength and slowed gait speed24. Healthcare professionals should enhance the assessment of blood phosphorus levels and debilitated conditions in MHD patients, recognizing the potential impact on cognitive function.

Total cholesterol

The risk of CF in elderly MHD patients is closely associated with abnormal total cholesterol levels. A study by Zhang Zanying et al. found that serum total cholesterol levels in the debilitated group were significantly higher than in the non-debilitated group25. Additionally, some studies have highlighted a correlation between elevated total cholesterol levels in the blood of elderly individuals and the onset of cognitive dysfunction26. Therefore, regular monitoring of total cholesterol levels, along with the assessment of related debilitating conditions and cognitive functions, is particularly crucial for elderly MHD patients.

Blood urea nitrogen

Elevated blood urea nitrogen (BUN) levels can place MHD patients in a highly toxic state, often accompanied by severe complications such as acidosis, electrolyte imbalances, and gastrointestinal dysfunction. These complications compromise the patient’s nutritional status and mobility, thereby contributing to the onset of frailty. Therefore, it is essential to ensure regular and adequate dialysis. In cases of high BUN levels, increasing the frequency of dialysis sessions or modifying the dialysis modality is necessary to effectively preserve the patients’ residual renal function and prevent the development of debilitation27.

Malnutrition

Malnutrition is a significant risk factor for frailty in elderly MHD patients. It acts as a pathophysiological mechanism contributing to both cognitive impairment and physical deterioration in these patients28. Chronic malnutrition can hinder neuronal regeneration in the brain, leading to neurotransmitter imbalances, which in turn damage brain structures and accelerate cognitive decline29. Additionally, malnutrition is closely associated with physical frailty, resulting in decreased body mass and reduced skeletal muscle mass, thereby increasing the risk of fractures, falls, and other accidents30. Therefore, healthcare professionals should collaborate with dietitians to develop personalized nutritional management plans to improve patients’ nutritional status to prevent or mitigate frailty.

Depression

Depression is a significant risk factor for frailty in MHD patients. It may be associated with oxidative stress, chronic inflammation, cerebrovascular disease, cerebral white matter lesions, and mitochondrial dysfunction, among other pathological factors31. MHD patients with depression often exhibit reduced volitional activity, lack of motivation and initiative, slowed cognition, and decreased social interaction and physical activity, all of which increase the risk of cognitive impairment and physical frailty32,33. Therefore, healthcare professionals should conduct a comprehensive assessment of the patient’s psychological state, offer individualized psychological support, and encourage active participation in social activities. These measures are essential for the further prevention of CF22.

In the risk factors screened in this study, in addition to the more widely recognized risk factors for CF in previous studies, such as age, exercise, serum albumin, depression, etc., some specific factors related to the development of CF in elderly patients with MHD, such as the patient’s dialysis vascular access, blood urea nitrogen, etc., were also included. Therefore, the risk factors used in this study are more comprehensive for MHD elderly patients, more targeted and specific, and more suitable to be applied to the screening of CF in MHD elderly patients. Meanwhile, the analysis results of this study showed that there were statistical differences between patients in the CF and non-CF groups in terms of dialysis vascular access and blood urea nitrogen (P < 0.2), indicating that the inclusion of MHD-specific indicators in this study is meaningful.

Analysis of CF risk prediction models for MHD patients

Traditional CF risk prediction models are primarily based on logistic regression, which, due to the limitations of the logistic regression algorithm, fails to accurately identify relevant influencing factors and cannot fully leverage the data characteristics. Additionally, selecting factors has not been comprehensive, resulting in limited model accuracy. This study conducted a cross-sectional survey to explore the influencing factors of CF in elderly patients with MHD, enriched the selection of influencing factors, and used five machine learning algorithms to establish a risk prediction model. An optimal integrated model was constructed based on the Stacking method. By comparing the optimal Stacking model with the five single models, the optimal model was identified to provide a tool for clinical healthcare workers to predict the risk of CF in elderly MHD patients at an early stage. The Stacking model and the five single models performed well, with AUC values ≥ 0.844, showing good differentiation, calibration, and clinical utility. The external validation set confirmed the accuracy of the Stacking model in predicting CF in MHD patients (AUC = 0.832).The web deployment of the model using the Streamlit library enables real-time online prediction, enhancing the model’s utility.

Limitations

This study has several limitations. First, participants were not randomly recruited due to resource and time constraints, which may have resulted in the underrepresentation of individuals with CF. Second, using a cross-sectional design raises concerns regarding the causal relationship between predictor variables and CF. Future studies could address this limitation by adopting a prospective cohort study design, which would help establish causality and enhance the predictive accuracy of the model.

Generalizability

The successful deployment of this model through a web-based interface offers the potential for its broader application in real-world clinical settings. With this tool, healthcare professionals can perform real-time risk assessments of patients to guide treatment decisions and improve patient outcomes. In terms of generalizability, the model developed in this study has the potential to be extended to other diseases with similar risk factors to CF. In addition, as machine learning technology continues to evolve, future studies may explore using more advanced algorithms, such as deep learning, to further improve prediction accuracy. In conclusion, the combination of machine learning and web-based deployment for CF risk prediction represents a significant step forward in incorporating artificial intelligence into clinical decision-making. The continued development and refinement of these models are expected to play an essential role in the future of individualized medicine.

Conclusion

Single models constructed with five different algorithms based on machine learning methods and the Stacking model are considered valuable tools for assessing CF risk in MHD patients, with the Stacking model regarded as the best-performing model.It was observed that factors such as age, mode of residence, medical payment method, exercise, alcohol consumption, dialysis vascular access, serum albumin classification, serum phosphorus classification, total cholesterol classification, blood urea nitrogen classification, malnutrition score, and depression score significantly influence the occurrence of CF in MHD patients. Therefore, targeted preventive measures should be implemented to address these factors. These models enable healthcare professionals to objectively assess the risk probability of CF in elderly MHD patients and provide a scientific basis for precise intervention.