Machine learning-based dynamic prediction model system for depression of middle-aged and elderly people

Through multi-dimensional health data collection and preprocessing, combined with machine learning algorithms and group-based multi-track model GBMTM, a dynamic prediction model is built, which solves the problem of difficulty in comprehensively and dynamically capturing the health status of middle-aged and elderly people in the existing technology, improves the prediction accuracy and interpretability of the model, and ensures the reliability of the model in different scenarios.

CN120452696APending Publication Date: 2025-08-08SOUTHWEST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510416638.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing technology is difficult to comprehensively and dynamically capture the complex and changeable health conditions of middle-aged and elderly people, resulting in limited prediction accuracy and generalization ability for depression and chronic diseases, and cannot meet the actual health management needs.

Method used

Through multi-dimensional health data collection and preprocessing, combining machine learning algorithms and group-based multi-trajectory model GBMTM, a dynamic prediction model is built, a variety of machine learning algorithms are used to build models, and hyperparameters are optimized through data division, resampling and cross-validation, and model performance is evaluated in combination with decision curve analysis, providing interpretability analysis and nomogram construction modules.

Benefits of technology

It realizes comprehensive and dynamic capture of the health status of middle-aged and elderly people, improves prediction accuracy and generalization capabilities, enhances the interpretability and practicality of the model, and ensures the reliability and practicality of the model in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120452696A_ABST
    Figure CN120452696A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of medical big data model construction, in particular to a dynamic prediction model system for depression of middle-aged and elderly people based on machine learning, and the system comprises a data collection module which is used for collecting individual multi-dimensional health data; the data preprocessing module is used for cleaning and standardizing the data; the feature selection module is used for screening key variables; the trajectory grouping module is used for identifying groups with similar health trajectories; the machine learning model module is used for constructing a dynamic prediction model by utilizing multiple machine learning algorithms; the model evaluation module is used for evaluating the performance of the index evaluation model; the interpretability analysis module is used for revealing the relationship between the key variable and the prediction result; and the column diagram construction module is used for generating static and dynamic column diagrams and providing visual prediction result display and personalized adjustment functions. The dynamic prediction model constructed by the invention can effectively capture the change trend of the individual health trajectory and provide a personalized prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical big data model construction, and in particular to a dynamic prediction model system for depression in middle-aged and elderly people based on machine learning. Background Art

[0002] As the global population ages, the health of middle-aged and elderly people is receiving increasing attention. Depression and chronic diseases, common health issues among middle-aged and elderly people, not only severely impact their quality of life but also place a significant economic and psychological burden on families and society. Accurately assessing and predicting depression and chronic diseases in middle-aged and elderly people is crucial for developing effective interventions and improving health management outcomes.

[0003] With the rapid development of big data and artificial intelligence technologies, data-driven and interpretable machine learning methods have shown great potential in health management and disease prediction. Existing probabilistic techniques that use big data to predict depression and chronic disease in middle-aged and elderly people are mostly based on single data sources or traditional statistical analysis methods. These techniques struggle to comprehensively and dynamically capture the complex and ever-changing health status of middle-aged and elderly people. They also fail to fully explore individual differences and potential factors influencing depression and chronic disease. This results in limited prediction accuracy and generalization, making them unable to effectively meet the needs of actual health management.

[0004] In summary, how to solve the problem that the existing probabilistic technologies that use big data to predict depression and chronic diseases in middle-aged and elderly people are mostly based on a single data source or traditional statistical analysis methods, and it is difficult to comprehensively and dynamically capture the complex and changeable health conditions of middle-aged and elderly people has become a difficult problem that needs to be solved urgently in this field. Therefore, it is necessary to propose a dynamic prediction model system for depression in middle-aged and elderly people based on machine learning. Summary of the Invention

[0005] To solve the above problems, the present invention provides a dynamic prediction model system for depression in middle-aged and elderly people based on machine learning. It is used to construct a dynamic prediction model by collecting and preprocessing multi-dimensional health data, combining machine learning algorithms and a group-based multi-trajectory model (GBMTM). It can effectively capture the changing trends of individual health trajectories and provide personalized prediction results.

[0006] To achieve the above objectives, the technical solution of the present invention is as follows: A dynamic prediction model system for depression in middle-aged and elderly people based on machine learning, comprising:

[0007] Data collection module, data preprocessing module, feature selection module, trajectory grouping module, machine learning model module, model evaluation module, interpretability analysis module, nomogram construction module and group-based multi-trajectory model GBMTM.

[0008] The data collection module is used to collect individual multidimensional health data; multidimensional health data includes sociodemographic characteristics, health status, lifestyle and medical record data.

[0009] The data preprocessing module is used to clean the collected individual multi-dimensional health data and standardize the individual multi-dimensional health data to obtain standardized individual multi-dimensional health data.

[0010] The feature selection module is used to use LASSO regression and recursive feature elimination (RFE) methods to screen out key variables that have an impact on the prediction of depression and chronic disease conditions from standardized individual multidimensional health data.

[0011] The trajectory grouping module is used to identify and classify key variables using the group-based multi-trajectory model GBMTM to identify and classify groups with similar health trajectories; groups with similar health trajectories include a normal trajectory group, a depression and chronic disease increase trajectory group, and a high depression and chronic disease trajectory group.

[0012] The machine learning model module is used to use one or more of the following algorithms: logistic regression algorithm (LR), multi-layer perceptron algorithm (MLP), lightweight gradient boosting machine algorithm (LightGBM), elastic network regression algorithm (Enet), decision tree algorithm (DT), support vector machine algorithm (SVM), k-nearest neighbor algorithm (KNN), random forest algorithm (RF) and extreme gradient boosting algorithm (XGB) to build a dynamic prediction model, and use the dynamic prediction model to predict the depression and chronic disease increase trajectory groups, generate prediction results of the probability of future increase in depression and chronic diseases, and optimize the hyperparameters of the dynamic prediction model through data partitioning, resampling and cross-validation.

[0013] The model evaluation module is used to evaluate the performance of the dynamic prediction model using evaluation indicators and introduce decision curve analysis (DCA) to evaluate the net benefit of the dynamic prediction model in practical applications.

[0014] The interpretability analysis module is used to explain the prediction results through SHAP values, quantify the contribution of each key variable to the prediction results output by the dynamic prediction model, and use restricted cubic spline RCS analysis to reveal the nonlinear relationship between key variables and the depression and chronic disease increase trajectory groups.

[0015] The nomogram construction module is used to construct static and dynamic nomograms based on the prediction results; the static nomogram is used to show the probability of an individual's future increase in depression and chronic diseases, and the dynamic nomogram is used for users to adjust the input parameters of the dynamic prediction model according to actual conditions, generate prediction results in real time, and update the static nomogram.

[0016] Furthermore, in the data collection module, multi-dimensional health data comes from the China Health and Retirement Longitudinal Survey CHARLS database.

[0017] Furthermore, in the data preprocessing module, the cleaning operation includes removing invalid data, removing missing value data, and removing outlier data.

[0018] Furthermore, in the feature selection module, key variables include age, gender, disability status, place of residence, self-reported health status, and average sleep duration.

[0019] Furthermore, in the machine learning model module, the method for optimizing the hyperparameters of the dynamic prediction model through data partitioning, resampling, and cross-validation includes the following steps:

[0020] S101, data partitioning: Divide the samples in the standardized individual multi-dimensional health data into training set, validation set and test set according to the ratio of 7:2:1; the training set is used to train the dynamic prediction model to obtain a trained dynamic prediction model; the validation set is used to evaluate the performance of the dynamic prediction model and adjust the hyperparameters during the training process; the test set is used to finally evaluate the generalization ability of the dynamic prediction model.

[0021] S102, resampling: When the number of samples of different categories in the standardized individual multi-dimensional health data is unbalanced, the random undersampling method is used to adjust the sample distribution.

[0022] S103, cross-validation: Use the k-fold cross-validation method to further divide the training set into k subsets. Each time, k-1 subsets are selected as training data, and the remaining 1 subset is used as validation data. Repeat this process k times and take the average of the k validation results as the performance indicator of the dynamic prediction model under this hyperparameter.

[0023] Furthermore, in the model evaluation module, the evaluation indicators include AUC, Kappa coefficient, sensitivity, specificity, MCC, Youden index, balanced accuracy, precision, recall, F1 score and Brier score.

[0024] Furthermore, in the model evaluation module, when evaluating the performance of the dynamic prediction model, the test set is input into the trained dynamic prediction model to generate prediction results. Based on the prediction results and the actual results, the performance of the model is evaluated using evaluation indicators.

[0025] Furthermore, in the model evaluation module, a decision curve analysis (DCA) method is introduced to evaluate the net benefit of the dynamic prediction model in practical applications, including the following steps:

[0026] S201, set the threshold range: from 0 to 1, with a step size of 0.01 to set the decision threshold.

[0027] S202, calculating the net benefit: For each decision threshold, the number of true positives and false positives is calculated based on the prediction results and actual results of the dynamic prediction model. The net benefit of the dynamic prediction model at this threshold is calculated by combining the set benefits and costs. The calculation formula of the net benefit is:

[0028] Net benefit = number of true positives / total number of samples - number of false positives / total number of samples × [threshold value / (1-threshold value)](1).

[0029] S203, drawing a decision curve: using the decision threshold as the horizontal axis and the net benefit as the vertical axis, draw a decision curve of the dynamic prediction model. At the same time, draw two reference lines, "individuals with depression or chronic diseases" and "individuals without depression or chronic diseases". "Individuals with depression or chronic diseases" means that all samples are regarded as positive, and "individuals without depression or chronic diseases" means that all samples are regarded as negative.

[0030] S204, result evaluation: When the decision curve of the dynamic prediction model is higher than the reference line within the threshold range, it means that the dynamic prediction model has a high net benefit in practical application.

[0031] Furthermore, in the interpretability analysis module, when quantifying the contribution of key variables to the prediction results through SHAP values, the SHAP values of key variables in each sample are calculated separately for the dynamic prediction model; when using restricted cubic spline RCS analysis, key variables associated with the depression and chronic disease increase trajectory groups are selected.

[0032] Furthermore, in the nomogram construction module, the specific steps for constructing static and dynamic nomograms are as follows:

[0033] S301, Static Nomogram Construction: Based on the prediction results generated by the machine learning model module, extract the probability of each individual experiencing an increase in depression and chronic diseases in the future; combine the probability of each individual experiencing an increase in depression and chronic diseases in the future with each individual's key variables to draw a static nomogram; the static nomogram displays the probability of each individual experiencing an increase in depression and chronic diseases in the future under different combinations of key variables;

[0034] S302, dynamic nomogram construction: provides a user interaction interface through which users adjust the input values of key variables. At the same time, based on the user's adjusted input values, the machine learning model module is called in real time to recalculate the probability of increased depression and chronic diseases in the future. At the same time, the nomogram is dynamically updated to display the adjusted probability of increased depression and chronic diseases in the future, and users make personalized predictions based on actual conditions. The input values of key variables include age, gender, disability status, place of residence, self-reported health status, and average sleep duration.

[0035] The above scheme has the following beneficial effects:

[0036] 1. This invention, through the collection and preprocessing of multidimensional health data, combined with machine learning algorithms and a population-based multi-trajectory model (GBMTM), can comprehensively and dynamically capture the complex and ever-changing health status of middle-aged and elderly people. Compared with traditional single data source or statistical analysis methods, this invention can more accurately identify the changing trends of individual health trajectories, improving prediction accuracy and generalization capabilities.

[0037] 2. This invention enhances the model's interpretability and practicality through an interpretability analysis module and a nomogram construction module. Through SHAP value and restricted cubic spline (RCS) analysis, users can clearly understand the contribution of each key variable to the prediction results. Static and dynamic nomograms provide intuitive prediction result presentation and personalized adjustment capabilities to meet practical health management needs.

[0038] 3. This invention improves the performance and stability of the prediction model by integrating and optimizing multiple machine learning algorithms. Model hyperparameters are optimized through methods such as data partitioning, resampling, and cross-validation. Decision curve analysis (DCA) is used to evaluate the net benefit of the model in practical applications, ensuring its reliability and practicality in different scenarios.

[0039] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a structural diagram of the dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning of the present invention.

[0041] Figure 2 This is a schematic diagram of the operation flow of the dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning of the present invention.

[0042] Figure 3 This is a schematic diagram of the identification and classification of key variables using a population-based multi-trajectory model in the dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning of the present invention.

[0043] Figure 4 This is a characteristic curve ROC and decision curve analysis DCA diagram in the dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning of the present invention.

[0044] Figure 5 This is a graph of the characteristic (ROC) curve and its corresponding area under the curve AUC value in the dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning of the present invention.

[0045] Figure 6This is an interpretability analysis diagram of the Shapley Additive exPlanations based on logistic regression and the restricted cubic spline RCS in the dynamic prediction model system of depression in the middle-aged and elderly population based on machine learning of the present invention.

[0046] Figure 7-9 These are the forest diagram, static nomogram and dynamic nomogram of the logistic regression (LR) model in the dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning of the present invention. DETAILED DESCRIPTION

[0047] The following is further described in detail through specific implementation methods:

[0048] As attached Figure 1 As shown in the figure: A dynamic prediction model system for depression in middle-aged and elderly people based on machine learning, which mainly includes a data collection module, a data preprocessing module, a feature selection module, a trajectory grouping module, a machine learning model module, a model evaluation module, an interpretability analysis module, a nomogram construction module and a group-based multi-trajectory model GBMTM; among them, the data collection module is mainly used to collect individual multi-dimensional health data; the data preprocessing module is mainly used to clean the collected multi-dimensional health data, remove invalid, missing and outlier data, and perform standardization processing; the feature selection module is mainly used to screen out key variables that have an impact on the prediction of depression and chronic diseases; the trajectory grouping module is mainly used to identify key variables The machine learning model module is mainly used to use a variety of machine learning algorithms to build a dynamic prediction model to predict the depression and chronic disease increase trajectory group and generate prediction results of the probability of depression and chronic disease increase in the future; the model evaluation module is mainly used to evaluate the model performance using evaluation indicators; the interpretability analysis module is mainly used to quantify the contribution of key variables to the prediction results and reveal the nonlinear relationship between key variables and the depression and chronic disease increase trajectory group; the nomogram construction module and the group-based multi-trajectory model GBMTM are mainly used to assist the trajectory grouping module in identifying and classifying key variables.

[0049] The following is a detailed explanation of the functions of each module:

[0050] The data collection module is used to collect individual multidimensional health data; multidimensional health data includes sociodemographic characteristics, health status, lifestyle and medical record data.

[0051] In the data collection module, multi-dimensional health data comes from the China Health and Retirement Longitudinal Survey (CHARLS) database.

[0052] The data preprocessing module is used to clean the collected individual multi-dimensional health data and standardize the individual multi-dimensional health data to obtain standardized individual multi-dimensional health data.

[0053] In the data preprocessing module, cleaning operations include removing invalid data, removing missing value data, and removing outlier data.

[0054] The feature selection module is used to use LASSO regression and recursive feature elimination (RFE) methods to screen out key variables that have an impact on the prediction of depression and chronic disease conditions from standardized individual multidimensional health data.

[0055] In the feature selection module, key variables include age, gender, disability status, place of residence, self-reported health status, and average sleep duration.

[0056] The trajectory grouping module is used to identify and classify key variables using the group-based multi-trajectory model GBMTM to identify and classify groups with similar health trajectories; groups with similar health trajectories include a normal trajectory group, a depression and chronic disease increase trajectory group, and a high depression and chronic disease trajectory group.

[0057] Specifically, first, the standardized key variable data is input into the population-based multi-trajectory model (GBMTM). For example, assuming there are sample data from 1,000 middle-aged and elderly people, the population-based multi-trajectory model (GBMTM) will perform a cluster analysis based on the changing trends of these key variables, including age, gender, disability status, place of residence, self-reported health status, and average sleep duration. Individuals whose key variables remain within the normal range as they age and who do not have obvious symptoms of depression or chronic diseases are classified as the normal trajectory group. Individuals whose disability worsens with age, whose self-reported health deteriorates, whose average sleep duration gradually decreases, and who begin to experience depressive symptoms or increase chronic disease indicators are classified as the depression and chronic disease increasing trajectory group. Individuals who already have severe disabilities, extremely poor health, chronic sleep deprivation, and who have been diagnosed with multiple chronic diseases and are in a state of high depression are classified as the high depression and chronic disease trajectory group.

[0058] In this way, individuals with similar health development trajectories are classified into corresponding groups for subsequent targeted analysis and prediction.

[0059] The machine learning model module is used to use one or more of the following algorithms: logistic regression algorithm (LR), multi-layer perceptron algorithm (MLP), lightweight gradient boosting machine algorithm (LightGBM), elastic network regression algorithm (Enet), decision tree algorithm (DT), support vector machine algorithm (SVM), k-nearest neighbor algorithm (KNN), random forest algorithm (RF) and extreme gradient boosting algorithm (XGB) to build a dynamic prediction model, and use the dynamic prediction model to predict the depression and chronic disease increase trajectory groups, generate prediction results of the probability of future increase in depression and chronic diseases, and optimize the hyperparameters of the dynamic prediction model through data partitioning, resampling and cross-validation.

[0060] In the machine learning model module, the method for optimizing the hyperparameters of the dynamic prediction model through data partitioning, resampling, and cross-validation includes the following steps:

[0061] S101, data partitioning: Divide the samples in the standardized individual multi-dimensional health data into training set, validation set and test set according to the ratio of 7:2:1; the training set is used to train the dynamic prediction model to obtain a trained dynamic prediction model; the validation set is used to evaluate the performance of the dynamic prediction model and adjust the hyperparameters during the training process; the test set is used to finally evaluate the generalization ability of the dynamic prediction model.

[0062] S102, resampling: When the number of samples of different categories in the standardized individual multi-dimensional health data is unbalanced, the random undersampling method is used to adjust the sample distribution.

[0063] S103, cross-validation: Use the k-fold cross-validation method to further divide the training set into k subsets. Each time, k-1 subsets are selected as training data, and the remaining 1 subset is used as validation data. Repeat this process k times and take the average of the k validation results as the performance indicator of the dynamic prediction model under this hyperparameter.

[0064] The model evaluation module is used to evaluate the performance of the dynamic prediction model using evaluation indicators and introduce decision curve analysis (DCA) to evaluate the net benefit of the dynamic prediction model in practical applications.

[0065] In the model evaluation module, evaluation metrics include AUC, Kappa coefficient, sensitivity, specificity, MCC, Youden index, balanced accuracy, precision, recall, F1 score, and Brier score. To evaluate the performance of a dynamic prediction model, the test set is fed into the trained dynamic prediction model to generate predictions. The model's performance is then evaluated using these metrics based on the comparison between the predicted and actual results.

[0066] In the model evaluation module, the decision curve analysis (DCA) method is introduced to evaluate the net benefit of the dynamic prediction model in practical applications, which includes the following steps:

[0067] S201, set the threshold range: from 0 to 1, with a step size of 0.01 to set the decision threshold.

[0068] S202, calculating the net benefit: For each decision threshold, the number of true positives and false positives is calculated based on the prediction results and actual results of the dynamic prediction model. The net benefit of the dynamic prediction model at this threshold is calculated by combining the set benefits and costs. The calculation formula of the net benefit is:

[0069] Net benefit = number of true positives / total number of samples - number of false positives / total number of samples × [threshold value / (1-threshold value)](1).

[0070] S203, drawing a decision curve: using the decision threshold as the horizontal axis and the net benefit as the vertical axis, draw a decision curve of the dynamic prediction model. At the same time, draw two reference lines, "individuals with depression or chronic diseases" and "individuals without depression or chronic diseases". "Individuals with depression or chronic diseases" means that all samples are regarded as positive, and "individuals without depression or chronic diseases" means that all samples are regarded as negative.

[0071] S204, result evaluation: When the decision curve of the dynamic prediction model is higher than the reference line within the threshold range, it means that the dynamic prediction model has a high net benefit in practical application.

[0072] Specifically, first, for example, a dynamic prediction model based on the extreme gradient boosting algorithm XGB has been trained using the machine learning model module.

[0073] Prepare a test set containing 500 samples of middle-aged and elderly people whose actual depression and chronic disease conditions are known.

[0074] The test set is input into the trained dynamic prediction model, and the model will output the probability prediction results of increased depression and chronic diseases in the future for each sample.

[0075] For example, the predicted probability of sample A suffering from depression in the future is 0.6, and the probability of suffering from chronic diseases is 0.4; the probability of sample B suffering from depression is 0.2, and the probability of suffering from chronic diseases is 0.1.

[0076] Based on the predicted results and the actual results, the performance of the model is evaluated using evaluation indicators.

[0077] For example, when calculating the AUC, the probabilities of increased depression and chronic disease in the future are sorted from highest to lowest. The true positive rate and false positive rate are then calculated, and the ROC curve is plotted to obtain the AUC value. If the final AUC value for the dynamic prediction model is 0.85, it indicates that the model performs well in distinguishing between samples with and without the disease.

[0078] Next, we introduce a decision curve to analyze the net benefit of the DCA evaluation model in practical applications. The decision threshold is set from 0 to 1, with a step size of 0.01. For example, when the threshold is set to 0.3, based on the predicted and actual results, the number of true positives is 100, the number of false positives is 30, and the total number of samples is 500. Assuming the benefit is set to 1 and the cost is 0.5, according to the net benefit formula: Net benefit = number of true positives / total number of samples - number of false positives / total number of samples × [threshold / (1 - threshold)], the net benefit under this threshold is calculated to be: 100 / 500 - 30 / 500 × [0.3 / (1 - 0.3)] ≈ 0.17.

[0079] Similarly, the net benefits at different thresholds were calculated. The decision curve for the dynamic prediction model was then plotted with the decision threshold as the horizontal axis and the net benefit as the vertical axis. Two reference lines were also drawn: for individuals with depression or chronic illness (i.e., all samples were considered positive, with a fixed net benefit) and for individuals without depression or chronic illness (i.e., all samples were considered negative, with a fixed net benefit).

[0080] If the decision curve of the dynamic prediction model finally drawn is higher than the two reference lines in most threshold ranges, it indicates that the dynamic prediction model has high net benefits in practical applications and has good practicality and reliability.

[0081] The interpretability analysis module is used to explain the prediction results through SHAP values, quantify the contribution of each key variable to the prediction results output by the dynamic prediction model, and use restricted cubic spline RCS analysis to reveal the nonlinear relationship between key variables and the depression and chronic disease increase trajectory groups.

[0082] In the interpretability analysis module, when quantifying the contribution of key variables to the prediction results through SHAP values, the SHAP values of key variables in each sample are calculated separately for the dynamic prediction model; when using restricted cubic spline RCS analysis, key variables associated with the depression and chronic disease increase trajectory groups are selected.

[0083] The nomogram construction module is used to construct static and dynamic nomograms based on the prediction results; the static nomogram is used to show the probability of an individual's future increase in depression and chronic diseases, and the dynamic nomogram is used for users to adjust the input parameters of the dynamic prediction model according to actual conditions, generate prediction results in real time, and update the static nomogram.

[0084] In the nomogram construction module, the specific steps for constructing static and dynamic nomograms are as follows:

[0085] S301, Static Nomogram Construction: Based on the prediction results generated by the machine learning model module, extract the probability of each individual experiencing an increase in depression and chronic diseases in the future; combine the probability of each individual experiencing an increase in depression and chronic diseases in the future with each individual's key variables to draw a static nomogram; the static nomogram displays the probability of each individual experiencing an increase in depression and chronic diseases in the future under different combinations of key variables;

[0086] S302, dynamic nomogram construction: provides a user interaction interface through which users adjust the input values of key variables. At the same time, based on the user's adjusted input values, the machine learning model module is called in real time to recalculate the probability of increased depression and chronic diseases in the future. At the same time, the nomogram is dynamically updated to display the adjusted probability of increased depression and chronic diseases in the future, and users make personalized predictions based on actual conditions. The input values of key variables include age, gender, disability status, place of residence, self-reported health status, and average sleep duration.

[0087] Specifically, first, assume that after predicting the depression and chronic disease increase trajectory groups through the machine learning model module, a series of prediction results are obtained.

[0088] For example, there are three middle-aged and elderly people. A is 65 years old, male, without disability, lives in the city, reports that he is in good health, and has an average sleep time of 7 hours. His probability of increased depression in the future is 0.2, and his probability of increased chronic diseases is 0.3; B is 70 years old, female, with mild disability, lives in the countryside, reports that he is in average health, and has an average sleep time of 6 hours. His probability of increased depression in the future is 0.4, and his probability of increased chronic diseases is 0.5; C is 75 years old, male, with severe disability, lives in the city, reports that he is in poor health, and has an average sleep time of 5 hours. His probability of increased depression in the future is 0.7, and his probability of increased chronic diseases is 0.8.

[0089] Based on these predictions, each individual's key variables are associated with the corresponding probability of increased depression and chronic illness in the future. Taking age as an example, the different age groups are labeled on the horizontal axis of the nomogram, and the corresponding scores are labeled on the vertical axis. For example, 60-69 years old corresponds to a score of 3, and 70-79 years old corresponds to a score of 5. The scores of each key variable for A, B, and C are summed to obtain a total score of 10 for A, 13 for B, and 18 for C. Based on the mapping between the total score and the probability of increased depression and chronic illness in the future, the nomogram is marked as follows: 10 points corresponds to a 0.2 increase in the probability of depression and a 0.3 increase in the probability of increased chronic illness; 13 points corresponds to a 0.4 increase in the probability of depression and a 0.5 increase in the probability of increased chronic illness; and 18 points corresponds to a 0.7 increase in the probability of increased depression and chronic illness in the future. This completes the construction of a static nomogram, which can intuitively display the probability of increased depression and chronic illness in individuals under different combinations of key variables.

[0090] The nomogram construction module can provide a simple user interaction interface, for example, the user interaction interface is a web form. User A enters his or her own information: age 68, female, mild disability, living in a rural area, self-reported general health, and average sleep duration of 6.5 hours. The system calls the machine learning model module in real time based on the user's input to recalculate, assuming that the probability of increased depression in the future is 0.35 and the probability of increased chronic disease is 0.45. The nomogram is then dynamically updated, highlighting the key variable positions corresponding to the information input by user A and the newly calculated probability of increased depression and chronic disease in the future. User A can then intuitively see the prediction results based on his or her actual situation. If user A subsequently changes his or her age to 72, the system will recalculate and update the nomogram in real time, displaying the new prediction results, and achieving personalized predictions.

[0091] The present invention can comprehensively and dynamically capture the complex and changing health conditions of the middle-aged and elderly population by collecting and preprocessing multi-dimensional health data, combining machine learning algorithms with a population-based multi-trajectory model (GBMTM). Compared with traditional single data sources or statistical analysis methods, the present invention can more accurately identify the changing trends of individual health trajectories, improving prediction accuracy and generalization capabilities. At the same time, the present invention improves the performance and stability of the prediction model through the integration and optimization of multiple machine learning algorithms. The model hyperparameters are optimized through methods such as data partitioning, resampling, and cross-validation, and the net benefit of the model in practical applications is evaluated in combination with decision curve analysis (DCA), ensuring the reliability and practicality of the model in different scenarios.

[0092] Example 2

[0093] like Figures 1-9 As shown, the difference from Example 1 is that this example is based on the China Health and Retirement Longitudinal Survey CHARLS data in 2011, 2013, 2015 and 2018. CHARLS is a nationally representative cohort study, and the baseline survey was conducted in 2011 using a multi-stage sampling method. The survey covered 28 provinces, 150 counties and districts, and 450 villages or urban communities in China. Follow-up surveys were conducted in 2013, 2015 and 2018, respectively, aiming to comprehensively collect information on the health status of the elderly population in China and its related factors. The study was approved by the Biomedical Ethics Review Committee of Peking University, and all participants signed written informed consent. This example follows the reporting guidelines of the "Guidelines for Strengthening Reporting of Epidemiological Observational Studies".

[0094] In this example, the study exclusion criteria included participants who were younger than 45 years old at baseline (n=2547), participants who lacked baseline depression scores and chronic disease data (n=1606), or key information missing (such as education level, marital status, smoking habits, drinking habits, self-rated health status and related disease conditions, etc.) (n=24565). In addition, 4569 participants were excluded due to the lack of depression and chronic disease data in the follow-up study. In addition, to ensure the stability of the study results, 6691 participants with only one measurement data were excluded. Finally, a total of 13073 participants had complete study data for at least two time points, and the data of these participants were included in the current analysis.

[0095] This example uses the 10-item version of the Center for Epidemiological Studies Depression Scale (CESD-10) to assess depressive symptoms. This scale has shown good validity in the assessment of depression in Chinese adults. The scale contains 10 items, each of which has four options based on the situation in the past week: 1. Rarely or never (<1 day); 2. Not much (1–2 days); 3. Sometimes or half the time (3–4 days); 4. Most or all of the time (5–7 days). The total score ranges from 0 to 30, with higher scores indicating more severe depressive symptoms. In the study, a CESD-10 score ≥10 was classified as having depressive symptoms, and a score <10 was classified as having no depressive symptoms.

[0096] A standardized questionnaire was used to investigate whether participants had ever been diagnosed with hypertension, dyslipidemia, diabetes, cancer, chronic lung disease, liver disease, heart disease, stroke, kidney disease, digestive system disease, mood, neurological or psychiatric problems, memory-related diseases, arthritis or rheumatism, or asthma. The total number of chronic diseases was also counted (range 0 to 14). Participants were then divided into four groups: 0 (no chronic disease), 1 (one chronic disease), 2 (two chronic diseases), and ≥3 (three or more chronic diseases).

[0097] This example uses a GBTM-based approach to identify groups with similar depressive trajectories. The basic principle of GBTM is to fit a trajectory model to a polynomial function of time or age. It is primarily used to analyze longitudinal data to identify clusters of individuals with similar trajectories and subgroups with distinct trajectory patterns.

[0098] Trajectory models were selected based on the following metrics: minimum Bayesian Information Criterion (BIC), minimum Akaike's Information Criterion (AIC), minimum log-likelihood (ll), and maximum entropy. Furthermore, to further validate the model's rationality, the average posterior probability (AvePP) (required to be greater than 0.7) and the predicted probability of group membership (PPGM, required to be greater than 5%) were used as supplementary statistical indicators.

[0099] To predict the depression trajectory group, this example preliminarily screened 14 variables based on previous studies. These variables were recorded in all four waves and were considered to be related to depression status.

[0100] The predictor variables in the study mainly cover three categories: sociodemographic characteristics, health status and health behaviors.

[0101] (a) Sociodemographic characteristics: including basic information such as age, gender, education level, marital status, and place of residence.

[0102] (b) Health status: involves multiple factors closely related to an individual's physical and mental health, such as average daily sleep time, self-rated health status (compared with the previous year), activities of daily living (ADL), instrumental activities of daily living (IADL), cognitive status (MMSE), and the presence of disability.

[0103] (c) Health behaviors: including smoking status, drinking status, whether to exercise and participation in daily leisure activities.

[0104] To avoid the impact of missing data on the prediction performance of the dynamic prediction model, this embodiment uses the missForest algorithm based on the random missing assumption to interpolate missing values. This algorithm has good performance in processing mixed-type data.

[0105] Parsimony is one of the core principles in building dynamic prediction models to prevent overfitting, which can be achieved through feature selection. Therefore, this example uses a two-stage screening method, including the least absolute shrinkage and selection operator (LASSO) and recursive feature elimination (RFE). In RFE, random forest (RF), decision tree (DT), and Bayesian (NB) are compared as base models.

[0106] First, the initial variables were screened using the LASSO model and recursive feature elimination (RFE) method. The LASSO model uses the L1 regularization constraint to screen out a sparse feature subset that is significantly correlated with the target variable. It has significant advantages in dealing with multicollinearity features and generates a model with high interpretability. In the RFE stage, recursive feature screening is performed based on three basic models: decision tree (DT), logistic regression (LR), and Bayesian (NB), to fully utilize the ability of different models to judge feature importance. Finally, considering the results of LASSO and RFE screening, six key variables were comprehensively identified. This multi-method fusion feature screening strategy not only effectively improves the predictive performance of the model, but also significantly reduces redundant features, further enhancing the model's simplicity and generalization ability.

[0107] The development and validation of the dynamic prediction model adhered to the Transparent Reporting Statement for Multivariate Prediction Models Used for Individual Prognosis or Diagnosis. Although only a single algorithm is needed for prediction in practical applications, to avoid model selection bias, multiple algorithms were tested, including logistic regression (LR), elastic net (Elastic Net), k-nearest neighbor (KNN), lightweight gradient boosting machine (LightGBM), decision tree (DT), multilayer perceptron (Multilayer Perceptron), random forest (RF), support vector machine (SVM), and extreme gradient boosting (XGBoost).

[0108] The data were randomly divided into a training set (70%) and a test set (30%). Given the imbalanced distribution of depression symptoms and sleep duration trajectories across groups, the training set was resampled using the synthetic minority oversampling technique (SMOTE) to reduce prediction bias caused by data imbalance.

[0109] To avoid data leakage and biased results, data processing, including imputation of missing values, feature selection, normalization, one-hot encoding, and resampling, was first performed on the training set after separating the test data. Hyperparameters on the training set were then optimized using a combination of 10-fold cross-validation and grid search, with the optimal hyperparameters selected based on prediction accuracy. Finally, internal validation was performed on the test set with 1000 bootstrap resamplings to assess the model's generalization ability.

[0110] In the present embodiment, the performance of nine kinds of machine learning models is comprehensively compared, and a variety of evaluation indicators are used to measure the performance of the model, including area under the receiver operating characteristic curve (AUC), accuracy, Kappa coefficient, sensitivity, specificity, MCC, Youden index, balanced accuracy, precision, recall, F1 score and Brier score (Supplementary Methods 6). Through these indicators, the classification performance of the model can be investigated from different angles. In addition, in order to further evaluate the effectiveness of each model in practical applications, decision curve analysis (DCA) is introduced, and the net benefit of the model is compared. This comprehensive evaluation method helps to more fully understand the advantages and disadvantages of each model and provides a scientific basis for the model selection in application.

[0111] Furthermore, based on the results of the LR model, a forest plot was used to display the key factors of the trajectory groups for depression and the number of chronic diseases. A nomogram suitable for practical applications was constructed based on the LR model. Finally, a dynamic nomogram was constructed to dynamically predict the trajectory groups for depression and the number of chronic diseases.

[0112] Sensitivity analyses were conducted to examine the robustness of the results. Given that trajectory analysis is more stable for individuals who complete more assessments over time, 8241 individuals who completed the CES-D10 score and chronic disease questionnaire assessments at at least three waves were included.

[0113] Statistical analyses were performed using R software (version 4.4.1) and Stata (18.0). Continuous variables were expressed as mean ± SD and compared using the Student's t-test or the Mann-Whitney test; categorical variables were described as frequencies (percentages) and compared using the chi-square test or Fisher's exact test.

[0114] Machine learning models were developed with the use of the “tidymodels” package in R software, and static and dynamic nomograms were constructed with the “rms,” “regplot,” “DynNom,” and “shiny” packages. A two-sided P value of less than 0.05 was considered statistically significant.

[0115] Combining depression status and the number of chronic diseases, the three trajectory groups (BIC = -232734.10, AIC = -232629.40, ll: -232601.40, Entropy = 0.927) were found to be the best trajectory model (based on Figure 3 for example).

[0116] like Figure 3As shown, 26.9% of individuals showed that the CES-D 10 scores (depression status) and the number of chronic diseases were relatively stable and at a low level. This group was defined as the "normal health status" trajectory group (Group 1). In addition, 55.6% of individuals showed an increasing trend in depression status and the number of chronic diseases compared with trajectory group 1 during the follow-up period, and their depression status was at a level that might cause depression. This group was defined as the "potential depression and increased disease status" trajectory group (Group 2). On the other hand, 17.5% of individuals showed more severe depression levels and a larger number of chronic diseases with an increasing trend during the follow-up period. This group was defined as the "high depression and high disease burden" trajectory group (Group 2).

[0117] At baseline, the mean age of participants was 57.31 ± 8.64 years, with 49.3% being women. The mean CES-D 10 score was 7.68 ± 5.99, and the mean sleep duration was 6.40 ± 1.76. Other characteristics of the participants and baseline characteristics of the different trajectory groups were compared.

[0118] This example combines LASSO regression and recursive feature elimination (RFE) methods to optimize the screening of predictive variables for the depression trajectory group. Through LASSO regression analysis, 7 key predictor variables were identified from 14 candidate variables. After comprehensively considering the simplicity and accuracy of the prediction model and combining the LASSO regression and RFE screening results, 6 core predictive features were finally determined. These features include baseline age, gender, disability status, place of residence, self-reported health status, and average sleep duration.

[0119] The performance evaluation results of the dynamic prediction model based on the test set are detailed in Figure 4 . Figure 4Performance was demonstrated in terms of recall, sensitivity, specificity, F1 score, accuracy, balanced accuracy, area under the receiver operating characteristic curve (AUROC), precision, and Brier score. Prediction models constructed using six key features selected using LASSO regression and recursive feature elimination (RFE) achieved AUROCs of 0.65 or above on the test set. Support Vector Machine (SVM) performed particularly well, with an AUC of 0.72. In comparison, other models, including logistic regression (LR) and extreme gradient boosting (XGBoost), achieved AUROC values exceeding 0.7. Specificity remained consistently high across all models, approaching 0.70, indicating reliable identification of negative cases. XGBoost achieved the highest accuracy of 0.54, while the F1 score and balanced accuracy remained stable across all models, approaching 0.47-0.50 and 0.56-0.59, respectively. Calibration, as measured by the Brier score, revealed low prediction errors between models, reflecting overall reliability. While support vector machines (SVMs) demonstrated the strongest discriminatory power, other models also demonstrated their unique strengths: XGBoost achieved the highest accuracy, random forests performed well in specificity, while logistic regression and ensemble methods maintained consistent calibration, highlighting the complementary strengths of different machine learning models across various performance metrics.

[0120] Figure 5 (AC) shows the receiver operating characteristic (ROC) curves and corresponding area under the curve (AUC) values of different machine learning models for predicting the three trajectory groups. Overall, the models demonstrated strong predictive performance in Groups 1 and 3, with AUC values close to 0.7, indicating good overall predictive accuracy. Among these models, support vector machine (SVM), logistic regression (LR), and XGBoost performed particularly well, demonstrating stable and superior predictive capabilities. However, the model performed relatively poorly in Group 2, with a significantly lower AUC value, which may be due to class imbalance or greater heterogeneity within this group.

[0121] Figure 5 (DF) The net benefits of different models at various decision thresholds were further evaluated by clinical decision curve analysis (DCA). The DCA results provide the potential benefits of the models in actual clinical applications. Figure 5In group D), most models showed high net gains in a lower decision threshold range (less than 0.3), especially logistic regression (LR) and XGBoost, which showed the potential of the models in actual clinical decision making. Figure 5 E), the overall net income of each model is low and shows a certain degree of fluctuation. Figure 5 F), XGBoost and support vector machine (SVM) showed higher net gains in the low threshold range, further confirming their predictive advantages and clinical application potential in group 3.

[0122] In this example, the logistic regression model performed well. To further explain the prediction results of the logistic regression model, the SHAP (SHapley Additive exPlanations) value was introduced to reveal the contribution of each variable to the model prediction output. SHAP can quantify the impact of each variable on the model result by decomposing the model's prediction results into the contribution values of each input feature. Figure 5 As shown in Figures (AC), SHAP analysis results indicate that self-reported health status, age, sleep duration, and disability status are the most important variables influencing model predictions for trajectory groups 1, 2, and 3. These characteristics play a central role in model outputs and provide important insights for future prevention of depression and the burden of chronic disease.

[0123] To further explore the relationship between core variables and depression and chronic disease burden and to simplify the research analysis, trajectory groups 2 and 3 were combined into the depression and chronic disease burden increased group. Based on restricted cubic spline (RCS) analysis ( Figure 5 D, Figure 5 E), the results showed that increasing age significantly increased the risk of depression and chronic disease burden in individuals, while increasing sleep duration could significantly reduce this risk.

[0124] like Figure 5 As shown in Figure A, logistic regression analysis revealed that baseline characteristics significantly predicted the "potential depression and increased illness" and "high depression and illness burden" trajectory groups. The results are presented as forest plots. Feature screening using LASSO and recursive feature elimination (RFE) methods ultimately identified six key influencing factors as important features for predicting these two trajectory groups.

[0125] Specifically, younger age, male sex, rural residence, no disability, better self-rated health, and longer sleep duration were identified as important protective factors. These characteristics significantly reduced the probability of middle-aged and elderly individuals entering the "potential increase in depression and illness" and "high depression and illness burden" trajectory groups. Conversely, older age, female sex, urban residence, disability, poor self-rated health, and shorter sleep duration were identified as significant risk factors, significantly increasing the risk of middle-aged and elderly individuals entering the above trajectory groups.

[0126] To further simplify the model and improve its practicality, this example combines the "potential depression and increased disease" and "high depression and disease burden" trajectory groups into the "depression and increased chronic disease burden" group, as both represent poor depression status and increased chronic disease burden. Based on this, a static nomogram ( Figure 5 B) and dynamic nomogram ( Figure 5 C) to display the predicted probability of an individual's future depression and increased chronic disease burden. Through interactive operations, the dynamic nomogram provides clinicians and individuals with a personalized risk assessment tool, providing a practical reference for early screening, risk stratification, and the development of intervention strategies for depression and chronic diseases.

[0127] Studies have shown that the risk of depression is higher in older adults with chronic diseases, and the number of chronic diseases is positively correlated with the risk of depression. However, most existing studies focus on a single disease, while research on the combined effects of depressive symptoms and chronic disease trajectories in middle-aged and elderly people is relatively limited.

[0128] This example utilizes CHARLS data from 2011 to 2018. Through group multi-trajectory modeling (GBMTM) analysis, three main depression and chronic disease trajectory types were identified, and it was found that only 26.9% of participants exhibited stable depression and chronic disease conditions during the study period. Furthermore, this example, combined with a machine learning algorithm, screened out six key predictors, including baseline age, place of residence, disability status, average sleep duration, self-reported health status, and gender. The importance of these factors in predicting different trajectory groups was explained by SHAP values, and restricted cubic spline (RCS) analysis revealed the nonlinear relationship between age and sleep duration and the increasing trajectory of depression and chronic diseases.

[0129] The results of the study indicate that middle-aged and older women who are younger, live in urban areas, experience poor sleep, have poor health, and have disabilities are more likely to be on a trajectory of depression and an increased burden of chronic disease. Depressive symptoms were found to be positively correlated with increasing age, and the number of chronic diseases increased with age. Existing research supports the idea that depression may further deteriorate neuropsychological function in older adults and increase their susceptibility to chronic diseases. Women, in particular, are at higher risk for chronic diseases such as cardiovascular disease and diabetes, and the dual effects of social and physiological factors make them more susceptible to depression.

[0130] In addition, there is a significant U-shaped relationship between sleep duration and depression risk. Both insufficient and excessive sleep may increase the risk of depression and have a negative impact on physical health. Disability not only increases the prevalence of chronic diseases, but is also associated with a high incidence of depressive symptoms. Therefore, improving basic health status and quality of life and maintaining good sleep quality are important for promoting active aging. Individuals with poor self-rated health often experience more significant depression and chronic disease problems due to physical dysfunction and emotional distress. Therefore, maintaining basic health status and improving quality of life are important for promoting active aging.

[0131] This example demonstrates the potential of combining machine learning techniques with existing health data as an effective screening tool. This tool not only helps optimize the assessment process for depression and chronic disease in middle-aged and elderly people, but also provides guidance for personalized and flexible prevention and treatment measures. The results first indicate that depression and chronic disease conditions in most middle-aged and elderly people show an upward trend with age. This trend is closely related to the gradual decline in physiological functions, particularly changes in brain structure and function. For example, brain atrophy and neurotransmitter imbalances may lead to reduced synthesis and availability of serotonin in the brain, thereby triggering depressive symptoms and further increasing the burden of chronic diseases. In addition, the low-cost and easily accessible predictors identified in this example, such as good sleep quality and maintaining a healthy state, provide a scientific basis for developing preventive strategies for high-risk groups. These strategies may help delay the worsening of depression and chronic disease symptoms.

[0132] The practical value of this embodiment is significant: First, the trajectory analysis based on hybrid models (GBMTM) method was used to explore the population characteristics of depression and chronic diseases in the elderly in China for the first time. Secondly, through the LASSO and RFE feature screening methods, and further interpretation of the SHAP value, this embodiment reveals the mechanism of action of different variables in affecting the trajectory categories of depression and chronic diseases. In addition, the nonlinear relationship between age and sleep time and the high-risk trajectory groups of depression and chronic diseases was analyzed through the RCS curve. Finally, the static and dynamic nomogram tools designed in this embodiment provide important technical support for personalized risk assessment in community medical services, thus laying the foundation for the formulation of early prevention and intervention strategies.

[0133] This example identifies three trajectories of depression and chronic disease comorbidity in the Chinese elderly population. The results show that women who reside in urban areas, are younger, have disabilities, report poor self-reported health, and have shorter sleep durations are more likely to fall into high-risk trajectories associated with increased risk of depression and chronic disease. Furthermore, the dynamic nomogram proposed in this example provides a practical tool for early risk identification, offering new insights into mental health screening and the precise development of intervention strategies for the elderly.

[0134] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will readily appreciate that other variations or modifications based on the above descriptions are possible. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.

Claims

1. A dynamic prediction model system for depression in middle-aged and elderly people based on machine learning, characterized by: include: Data collection module, data preprocessing module, feature selection module, trajectory grouping module, machine learning model module, model evaluation module, interpretability analysis module, nomogram construction module and group-based multi-trajectory model GBMTM; The data collection module is used to collect individual multidimensional health data; the multidimensional health data includes sociodemographic characteristics, health status, lifestyle, and medical record data; The data preprocessing module is used to clean the collected individual multi-dimensional health data and standardize the individual multi-dimensional health data to obtain standardized individual multi-dimensional health data; A feature selection module, which uses LASSO regression and recursive feature elimination (RFE) to screen key variables that have an impact on the prediction of depression and chronic disease conditions from standardized individual multidimensional health data; The trajectory grouping module is used to identify and classify key variables using the group-based multi-trajectory model (GBMTM) to identify and classify groups with similar health trajectories; groups with similar health trajectories include a normal trajectory group, a depression and chronic disease increase trajectory group, and a high depression and chronic disease trajectory group; A machine learning model module is used to build a dynamic prediction model using one or more of a logistic regression algorithm (LR), a multi-layer perceptron algorithm (MLP), a lightweight gradient boosting machine algorithm (LightGBM), an elastic net regression algorithm (Enet), a decision tree algorithm (DT), a support vector machine algorithm (SVM), a k-nearest neighbor algorithm (KNN), a random forest algorithm (RF), and an extreme gradient boosting algorithm (XGB), and use the dynamic prediction model to predict depression and chronic disease increase trajectory groups, generate prediction results for the probability of future depression and chronic disease increases, and optimize hyperparameters of the dynamic prediction model through data partitioning, resampling, and cross-validation; The model evaluation module is used to evaluate the performance of the dynamic prediction model using evaluation indicators and introduce decision curve analysis (DCA) to evaluate the net benefit of the dynamic prediction model in practical applications; The interpretability analysis module is used to explain the prediction results through SHAP values, quantify the contribution of each key variable to the prediction results output by the dynamic prediction model, and use restricted cubic spline RCS analysis to reveal the nonlinear relationship between key variables and the depression and chronic disease increase trajectory groups; The nomogram construction module is used to construct static and dynamic nomograms based on the prediction results; the static nomogram is used to show the probability of an individual's future increase in depression and chronic diseases, and the dynamic nomogram is used for users to adjust the input parameters of the dynamic prediction model according to actual conditions, generate prediction results in real time, and update the static nomogram.

2. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 1 is characterized in that: In the data collection module, multi-dimensional health data comes from the China Health and Retirement Longitudinal Survey (CHARLS) database.

3. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 2 is characterized in that: In the data preprocessing module, cleaning operations include removing invalid data, removing missing value data, and removing outlier data.

4. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 3 is characterized in that: In the feature selection module, key variables include age, gender, disability status, place of residence, self-reported health status, and average sleep duration.

5. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 4 is characterized in that: In the machine learning model module, the method for optimizing the hyperparameters of the dynamic prediction model through data partitioning, resampling, and cross-validation includes the following steps: S101, Data Partitioning: Divide the standardized individual multi-dimensional health data samples into a training set, a validation set, and a test set according to a ratio of 7:2:1; the training set is used to train the dynamic prediction model to obtain a trained dynamic prediction model; the validation set is used to evaluate the performance of the dynamic prediction model and adjust hyperparameters during the training process; and the test set is used to ultimately evaluate the generalization ability of the dynamic prediction model; S102, resampling: when the number of samples of different categories in the standardized individual multi-dimensional health data is unbalanced, the random undersampling method is used to adjust the sample distribution; S103, cross-validation: Use the k-fold cross-validation method to further divide the training set into k subsets. Each time, k-1 subsets are selected as training data, and the remaining 1 subset is used as validation data. Repeat this process k times and take the average of the k validation results as the performance indicator of the dynamic prediction model under this hyperparameter.

6. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 5 is characterized in that: In the model evaluation module, evaluation indicators include AUC, Kappa coefficient, sensitivity, specificity, MCC, Youden index, balanced accuracy, precision, recall, F1 score and Brier score.

7. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 6 is characterized in that: In the model evaluation module, when evaluating the performance of the dynamic prediction model, the test set is input into the trained dynamic prediction model to generate prediction results. Based on the prediction results and the actual results, the performance of the model is evaluated using evaluation indicators.

8. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 7 is characterized in that: In the model evaluation module, the decision curve analysis (DCA) method is introduced to evaluate the net benefit of the dynamic prediction model in practical applications, which includes the following steps: S201, set the threshold range: from 0 to 1, with a step size of 0.01 to set the decision threshold; S202, calculating the net benefit: For each decision threshold, the number of true positives and false positives is calculated based on the prediction results and actual results of the dynamic prediction model. The net benefit of the dynamic prediction model at this threshold is calculated by combining the set benefits and costs. The calculation formula of the net benefit is: Net benefit = number of true positives / total number of samples - number of false positives / total number of samples × [threshold value / (1-threshold value)](1); S203, drawing a decision curve: using the decision threshold as the horizontal axis and the net benefit as the vertical axis, a decision curve of the dynamic prediction model is drawn. At the same time, two reference lines are drawn: "individuals with depression or chronic diseases" and "individuals without depression or chronic diseases." "Individuals with depression or chronic diseases" means that all samples are considered as positive, and "individuals without depression or chronic diseases" means that all samples are considered as negative. S204, result evaluation: When the decision curve of the dynamic prediction model is higher than the reference line within the threshold range, it means that the dynamic prediction model has a high net benefit in practical application.

9. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 8 is characterized in that: In the interpretability analysis module, when quantifying the contribution of key variables to the prediction results through SHAP values, the SHAP values of key variables in each sample are calculated separately for the dynamic prediction model; when using restricted cubic spline RCS analysis, key variables associated with the depression and chronic disease increase trajectory groups are selected.

10. The dynamic prediction model system for depression in the middle-aged and elderly population based on machine learning according to claim 9 is characterized in that: In the nomogram construction module, the specific steps for constructing static and dynamic nomograms are as follows: S301, Static Nomogram Construction: Based on the prediction results generated by the machine learning model module, extract the probability of each individual experiencing an increase in depression and chronic diseases in the future; combine the probability of each individual experiencing an increase in depression and chronic diseases in the future with each individual's key variables to draw a static nomogram; the static nomogram displays the probability of each individual experiencing an increase in depression and chronic diseases in the future under different combinations of key variables; S302, Dynamic Nomogram Construction: Providing a user interface through which users adjust the input values of key variables. Simultaneously, based on the user-adjusted input values, the machine learning model module is called in real time to recalculate the probability of future increases in depression and chronic diseases. Simultaneously, the nomogram is dynamically updated to display the adjusted probabilities of future increases in depression and chronic diseases, allowing users to make personalized predictions based on their actual conditions. Input values for key variables included age, sex, disability status, place of residence, self-reported health status, and average sleep duration.