A method for predicting the response of patients with septic shock to methylene blue therapy based on an interpretable model
Through multi-method feature engineering and SHAP interpreter based on interpretable models, the uncertainty problem of the response prediction of methylene blue drugs in patients with septic shock is solved, and the accurate prediction of methylene blue treatment response and optimization of treatment plans are achieved. .
Patent Information
- Application Number
- CN202410740617.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-09
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-06-09
AI Technical Summary
The prior art cannot effectively predict the response of patients with septic shock to methylene blue drugs, and the appropriate population is not specified, resulting in uncertainty in its use in clinical applications.
Using multiple method multiple screening feature engineering based on interpretable models, we construct clinical data sets of septic shock methylene blue treatment response, use machine learning models to predict drug treatment response, and interpret the optimal model through SHAP interpreter to find out the impact sub-influence A key factor in the effectiveness of A-Blue boost.
Accurate prediction of methylene blue treatment response in septic shock patients is achieved, which improves the interpretability of the model and the credibility of doctor decisions, reduces the risk of drug misuse, and optimizes the treatment plan.
Smart Images

Figure CN118609852B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer and medical model data processing, and in particular to a method for predicting the methylene blue treatment response of septic shock patients (i.e. septic shock patients) based on an interpretable model. Background Art
[0002] Septic shock, also known as septic shock, is a sepsis syndrome accompanied by shock caused by microorganisms and their toxins. Septic shock is one of the most common causes of shock in the intensive care unit (ICU). Its clinical manifestations are complex and diverse. It is also the main cause of death in ICU patients, with an in-hospital mortality rate of more than 50%. Vascular paralysis is the main pathophysiological mechanism of septic shock. The combined use of pressor drugs with different mechanisms to reduce the dosage of catecholamines is a research hotspot.
[0003] At present, the guidelines for the treatment of septic shock recommend that norepinephrine is the preferred pressor drug, but long-term use of high doses may cause serious adverse consequences including renal tubular necrosis and liver necrosis. In addition, patients who do not respond to norepinephrine often need to be treated with other vasoactive drugs. However, the high-dose use of vasoactive drugs can lead to adverse reactions. The existing treatment options for septic shock have not effectively reduced the mortality of patients, and new drugs are still needed to provide new possibilities for the treatment of patients with septic shock. Methylene blue (MB), as a selective nitric oxide synthase inhibitor, partially blocks the vasodilatory effect of nitric oxide. It is a safe, inexpensive, and easily available auxiliary pressor drug and has received increasing attention in recent years. Many studies have shown that methylene blue can significantly increase blood pressure in various vasoplegic shocks, reduce the use of norepinephrine, and even reduce patient mortality. However, due to the lack of sufficient evidence-based medicine, it is impossible to determine which patients can benefit from methylene blue treatment, and the key factors affecting the effectiveness of methylene blue pressor are still unclear.
[0004] With the rapid development of technologies such as machine learning and artificial intelligence, the deep cross-integration of medicine and computers has led to continuous innovation in the medical field. Machine learning models have made significant progress in drug efficacy evaluation, providing new possibilities for personalized treatment. Machine learning prediction models help identify effective populations. Combined with interpretable tools, they can improve the comprehensibility and credibility of the models and assist doctors in making clinical decisions. It is of great significance to use interpretable machine learning algorithms from a data-driven perspective to deeply explore patients' individual responses to methylene blue.
[0005] In summary, as one of the potential pressor drugs for septic shock, the effectiveness of methylene blue is difficult to predict, and the appropriate population is also unknown. In clinical practice, whether methylene blue is used to increase blood pressure in patients with septic shock mainly depends on the experience of doctors, which affects the rational use of methylene blue in clinical practice. At present, no public technical solutions have been found to use interpretable machine learning methods to predict the treatment response of methylene blue in patients with septic shock. Summary of the invention
[0006] The technical problem to be solved by the present invention is that the key factors of the response of septic shock patients to methylene blue are currently unknown, the effectiveness of methylene blue as one of the potential pressor drugs for septic shock patients cannot be predicted by the existing technology, and the suitable population cannot be known. A method for predicting the methylene blue treatment response of septic shock patients (i.e., septic shock patients) based on an interpretable model is provided, two groups of clinical data sets of methylene blue drug treatment response for septic shock are constructed through multi-method multi-screening feature engineering, different machine learning models are used to predict the drug treatment response, and the SHAP (SHapley Additive exPlanations) interpreter is introduced to interpret the optimal machine learning model, the key factors affecting the pressor effectiveness of methylene blue are found, the effectiveness of methylene blue as one of the potential pressor drugs for septic shock patients is predicted, and the suitable population is found.
[0007] The technical solution of the present invention is:
[0008] The first step is to build a prediction system for the response to methylene blue treatment of patients with septic shock. The prediction system for the response to methylene blue treatment of patients with septic shock consists of a data preprocessing module, a feature engineering module, and a response prediction module.
[0009] The data preprocessing module is connected to the feature engineering module. During training, the data preprocessing module reads the original data set S1 (S1 consists of 24 features), performs data cleaning on the features in S1, and obtains the cleaned data set S2; then performs data transformation on S2, first performs data standardization on the continuous features in S2, obtains the standardized data set S2', and then performs unique hot encoding on the categorical features in S2' to obtain the preprocessed data set S3, and sends S3 to the feature engineering module. When predicting the septic shock patient data X input by the user, X is cleaned to obtain the cleaned data X', and then X' is transformed to obtain the preprocessed septic shock patient data X"', and X"' is sent to the response prediction module.
[0010] The feature engineering module is connected to the data preprocessing module and the response prediction module. Since the research object data set of the present invention is generally small and has a large number of features, directly inputting all the data for model training can easily lead to overfitting. Therefore, the present invention adopts two methods to perform feature engineering on S3, one is based on the statistical method commonly used in clinical research, and the other is based on the machine learning method. During training, the feature engineering module receives the data set S3 input by the data preprocessing module, first uses the statistical method to screen significant features, obtains the first data set pv_data, and divides pv_data into the first training set pv_train and the first test set pv_test. Then, the machine learning method is used to perform feature screening on S3 to obtain the second data set ml_data, and ml_data is divided into the second training set ml_train and the second test set ml_test. The first training set pv_train, the first test set pv_test, the second training set ml_train, and the second test set ml_test are sent to the response prediction module.
[0011] The response prediction module is connected to the feature engineering module and the data preprocessing module. The response prediction module consists of a model training submodule, a model screening submodule, a model interpretation submodule, and a prediction model. The model training submodule is connected to the feature engineering module and the model screening submodule, and includes a logistic regression model (LR), a random forest model (RF), a support vector machine model (SVM), an explainable boosting machine model (EBM), and a light gradient boosting machine model (Light GBM). During training, the model training submodule receives the first training set pv_train input by the feature engineering module, trains 5 models, and adjusts the hyperparameters of the 5 models to obtain 5 response prediction models. The model training submodule also receives the second training set ml_train input by the feature engineering module, trains 5 models, and adjusts the hyperparameters of the 5 models to obtain 5 response prediction models. After training, a total of 10 response prediction models are obtained, and the 10 response prediction models are sent to the model screening submodule.
[0012] The model screening submodule is connected to the feature engineering module, the model training submodule, and the model interpretation submodule. During training, the model screening submodule receives 10 response prediction models input by the model training submodule, and when receiving the first test set pv_test input by the feature engineering module, the 5 response prediction models established based on the first training set pv_train are evaluated; when receiving the second test set ml_test input by the feature engineering module, the 5 response prediction models established based on the second training set ml_train are evaluated, and the 10 response prediction models received from the model training submodule are evaluated to obtain the best response prediction model. The best response prediction model and the data set used by it are sent to the model interpretation submodule (for example, if the best response prediction model is an SVM model established based on the first training set pv_train, the first training set pv_train and the SVM model are sent together to the model interpretation submodule).
[0013] The model interpretation submodule is connected to the model screening submodule. During training, the model interpretation submodule receives the best response prediction model and the data set used by it input by the model screening submodule, inputs them into the SHAP interpreter, and uses the SHAP interpreter to perform global interpretation (obtaining the importance of each feature to the prediction of methylene blue drug response) and local interpretation (obtaining how each feature affects the prediction model's prediction of a single patient) of the best response prediction model.
[0014] The best response prediction model and SHAP interpreter together constitute the final prediction model obtained through training. When predicting the single septic shock patient data X input by the user, the prediction model receives X'' input by the data preprocessing module, and the best response prediction model in the prediction model outputs the prediction result of the patient's response to the methylene blue drug (response / no response). The SHAP interpreter in the prediction model outputs the SHAP value of each feature for the patient's response prediction result, and visualizes these SHAP values to show the contribution of each feature to the patient's response prediction result.
[0015] The second step is to construct the original dataset S1 by:
[0016] 2.1 Initialize the original data set S1 to be empty. Each table entry of S1 includes 26 fields, namely the patient ID number (unique), 24 features for building the model, and the label of whether the patient responds to the methylene blue drug.
[0017] 2.2 The ID numbers of patients who met the following three conditions were extracted from the hospital's sepsis database: (1) diagnosed with septic shock; (2) aged ≥18 years; (3) receiving methylene blue as a second-line vasopressor (methylene blue was started at least 6 hours after the patient received norepinephrine infusion). If the patient used methylene blue to increase blood pressure multiple times, only those with a time interval of more than 6 hours from the second use of methylene blue were included in S1.
[0018] The patient ID numbers that meet one of the following conditions are deleted from S1: (1) The ICU hospital stay after using methylene blue is less than 24 hours; (2) It is unclear whether methylene blue is used to increase blood pressure and the effectiveness cannot be judged due to missing data. Let the patient ID numbers in S1 be M at this time, M is a positive integer, that is, S1 has M entries at this time, and 1 entry corresponds to 1 patient sample.
[0019] 2.3 According to the patient ID number in S1, 24 features for model construction were extracted from the hospital's sepsis database, including patient gender, age at hospitalization (years), weight (kg), smoking history, drinking history, comorbidities (hypertension, diabetes, coronary heart disease, atrial fibrillation, lung disease, kidney disease, liver disease, immune suppression), ICU type (central ICU and other ICUs), whether terlipressin was used, whether hormones were used, and the average norepinephrine equivalent (NEE) 6 hours before starting methylene blue. pre ), oxygen therapy method (invasive ventilator-assisted breathing and non-invasive assisted breathing), oxygenation index (OI), whether continuous renal replacement therapy (CRRT), lactate, central venous oxygen saturation (ScvO2), time from the start of methylene blue to the first start of norepinephrine (T NE ), the time from the start of methylene blue to the diagnosis of shock (T shock ), put these contents into the table corresponding to the patient id number of S1. The above 24 features are divided into continuous features and categorical features. Continuous features include the patient's age (years), weight (kg), NEE pre , OI, lactate, ScvO2, T NE 、T shock The classification characteristics include patient gender, smoking history, drinking history, hypertension, diabetes, coronary heart disease, atrial fibrillation, lung disease, kidney disease, liver disease, immune suppression, ICU type, whether terlipressin is used, whether hormones are used, oxygen therapy method, and whether continuous renal replacement therapy is used.
[0020] Among them, the average nor-methyl equivalent (NEE) 6 hours before starting methylene blue pre) is used to calculate the amount of norepinephrine equivalent (NEE) used within 6 hours before starting methylene blue (assuming that all drugs are used at a uniform rate). The calculation formula for NEE (see the literature "Kotani, Y., DiGioia, A., Landoni, G. et al. An updated "norepinephrine equivalent" score in intensive care as a marker of shock severity[J]. Crit Care, 2023, 27(1): 29.", Kotani, Y. et al.'s paper: An updated "norepinephrine equivalent" score in intensive care as a marker of shock severity) is: NEE = Norepinephrine dose (μg / kg / min) + 1 / 100 × dopamine dose (μg / kg / min) + 0.06 × phenylephrine dose (μg / kg / min) + 10 × terlipressin dose (μg / kg / min) + 0.2 × methylene blue blue methylene blue dose (mg / kg / h) + 8×metaraminol dose (μg / kg / min) + 0.02×hydroxocobalamin vitamin B12 dose (g) + 0.4×midodrine dose (μg / kg / min). . Oxygenation index OI = PaO2 / FiO2, where PaO2 is the partial pressure of oxygen in arterial blood, FiO2 is the percentage of inspired oxygen concentration, and the normal value of OI is 400-500mmHg. Lactic acid is mainly used to detect the lactate content in the blood, and the normal value is generally 0.5-1.7mmol / L. Central venous oxygen saturation (ScvO2) refers to the oxygen saturation level in the central venous blood of the human body. It is one of the important indicators for evaluating the balance of oxygen supply and demand in patients. The normal value of ScvO2 is between 70% and 75%.
[0021] 2.4 According to the following conditions, obtain the labels of whether the M patients in S1 respond to methylene blue (the label is 1 when there is a response, and the label is 0 when there is no response).
[0022] Patients who responded to methylene blue (i.e., effective pressor) were defined as meeting one of the following two conditions: (1) NEE decreased by >10% (i.e., NEE% <-10%) and mean arterial pressure (MAP_avg_post) ≥65 mmHg; (2) NEE decreased, remained unchanged, or increased by <10% (i.e., 10% > NEE% ≥-10%) but mean arterial pressure change (MAP_avg%) increased by ≥10 mmHg. Specifically, when one of the above two conditions was met, methylene blue pressor was considered effective, and the label corresponding to the patient ID number in S1 was assigned a value of 1. When both conditions were not met, methylene blue pressor was defined as ineffective, and the label corresponding to the patient ID number in S1 was assigned a value of 0.
[0023] Where, the change value of NEE (NEE%) = (NEE post -NEE pre ) / NEE pre ×100%,NEE post The average amount of methylene blue (same as NEE) is 6 hours after the start of methylene blue pre It can be calculated by the formula). Mean arterial pressure (MAP) = [systolic pressure + (diastolic pressure × 2)] / 3. The normal value of mean arterial pressure for normal adults is 70-105 mmHg. The average value of mean arterial pressure (MAP_avg) within 6 hours before and after the start of methylene blue is calculated to obtain MAP_avg_pre and MAP_avg_post. The change value of MAP_avg (MAP_avg%) = (MAP_avg_post-MAP_avg_pre). At this time, the patient who responded in S1 is M_1, and the patient who did not respond is M_0.
[0024] In the third step, the data preprocessing module preprocesses the data set S1 to obtain the preprocessed data set S3.
[0025] 3.1 Clean up the data of S1 by:
[0026] 3.1.1 Use a boxplot to detect outliers (wrongly recorded data values or abnormal data values) in S1, delete the outliers or fill them with the average value of the feature, and obtain the data set S1'. There are M2 patient id numbers in S1', M2≤M and M2 is a positive integer.
[0027] 3.1.2 Delete features in S1' where the missing data ratio (the ratio of the number of missing data in a feature (such as weight, age) to the total number of data M2) exceeds 30%. For features where the missing data ratio is <30%, use the multi-KNN interpolation method (see the paper "Thomas T, et al. Addressing missing data in a healthcare dataset using an improved knn algorithm [C]. 2021" Thomas T et al.'s paper: Using the improved knn algorithm to address missing data in healthcare datasets) for interpolation. The specific steps are:
[0028] 3.1.2.1 Split S1' into a part S11 with missing values and a complete part S12. S11 is the feature that needs to be interpolated.
[0029] 3.1.2.2 Interpolate S11 to obtain K (K is a positive integer, preferably 20) interpolated data sets S111, ..., S11 k , …, S11 K (1≤k≤K and k is a positive integer), S111,…, S11 k , …, S11 K The patient ID numbers in the table are all M2. The difference from S11 is that the features with missing data ratio <30% have been fully imputed, and there are no features with missing data ratio ≥30%. Based on S111, ..., S11 k , …, S11 K Randomly divide the training set and test set and perform model training and evaluation to obtain avg_accuracy1, ..., avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K ,avg_accuracy k For S11 k Evaluation indicator average accuracy, avg_rmse k For S11 k The evaluation indicator of is the average root mean square error; the specific process is:
[0030] 3.1.2.2.1 Let k = 1:
[0031] 3.1.2.2.2 Perform the k-th KNN interpolation on the missing values of each feature in S11:
[0032] 3.1.2.2.2.1 Calculate the distance between the samples with missing feature values in S11 and each sample in S12;
[0033] 3.1.2.2.2.2 Select the k samples with the closest distance;
[0034] 3.1.2.2.2.3 For continuous features in S11, fill missing values by calculating the average value of k samples by weighted average; for categorical features in S11, fill missing values by voting to select the most frequent category in the categorical features, and obtain the interpolated S11';
[0035] 3.1.2.2.2.4 Combine the interpolated S11' and S12 to obtain the k-th interpolated dataset S11 k .
[0036] 3.1.2.2.3 For S11 k Perform N (N is a positive integer, preferably 20) evaluations to obtain N pairs of S11 k The evaluation indicators are accuracy-1, ..., accuracy-n, ..., accuracy-N and N root mean square errors rmse-1, ..., rmse-n, ..., rmse-N (1≤n≤N and n is a positive integer); accuracy-n is the nth evaluation of S11 k The evaluation index accuracy, rmse-n is the nth time for S11 k The evaluation indicator root mean square error is:
[0037] 3.1.2.2.3.1Let n = 1;
[0038] 3.1.2.2.3.2 For S11 k Randomly divide the data in a ratio of 3:1 to obtain the training set n_train and the test set n_test (each division is random, and the obtained n_train and n_test are different);
[0039] 3.1.2.2.3.3 Train the random forest model based on n_train, evaluate the established random forest model based on n_test, and calculate the accuracy accuracy-n and the root mean square error rmse-n of the random forest model after the nth training;
[0040] 3.1.2.2.3.4 Let n = n + 1. If n ≤ N, go to 3.1.2.2.3.2 to continue randomly dividing the training set and test set and perform model training and evaluation. Otherwise, after obtaining accuracy-1, …, accuracy-n, …, accuracy-N and rmse-1, …, rmse-n, …, rmse-N, go to 3.1.2.2.4.
[0041] 3.1.2.2.4 Calculate the average of accuracy-1, ..., accuracy-n, ..., accuracy-N and get S11 k The average accuracy avg_accuracy k , calculate the average of rmse-1, ..., rmse-n, ..., rmse-N, and get S11 k The average root mean square error avg_rmse k ;
[0042] 3.1.2.2.5 Let k = k + 1. If k ≤ K, go to 3.1.2.2.1. Otherwise, get avg_accuracy1, ..., avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K , go to 3.1.2.3.
[0043] 3.1.2.3 Comparison of avg_accuracy k , …, avg_accuracy k , …, avg_accuracy K and avg_rmse1,…,avg_rmse k , …, avg_rmse K , select the data set S11 corresponding to the k value with the largest average accuracy and relatively small average root mean square error k As the cleaned data set S2, there are T features in S2, including T1 continuous features and T2 categorical features, T1+T2=T, T≤24 and T is a positive integer.
[0044] 3.2 Transform the data of S2 by:
[0045] 3.2.1 The T1 continuous feature data of M2 patients in S2 are standardized using the Z-Score standardization method (the categorical feature data are not processed) to obtain the standardized data set S2'. The method is:
[0046] 3.2.1.1 Divide S2 into a part S21 containing T1 continuous feature data and a part S22 containing T2 categorical feature data.
[0047] 3.2.1.2 Standardize the features in S21 to obtain the standardized data set S21', the method is:
[0048] 3.2.1.2.1 Let variable i = 1 (i value ranges from 1 to T1, i is a positive integer)
[0049] 3.2.1.2.2 Calculate the mean μ of the i-th continuous feature in S21 i and standard deviation σ i ;
[0050] 3.2.1.2.3 Perform data standardization on the i-th continuous feature of M2 patients in S21 to obtain the value of M2 standardized i-th continuous feature, the method is:
[0051] 3.2.1.2.3.1 Let variable j = 1 (the value of j ranges from 1 to M2, and j is a positive integer);
[0052] 3.2.1.2.3.2 The characteristic value x of the jth patient for the i-th continuous characteristic j Standardize and get x j ′, the calculation formula is:
[0053]
[0054] Among them, x j is the original eigenvalue of the jth patient, x j ′ is the normalized eigenvalue.
[0055] 3.2.1.2.3.3 Using the standardized eigenvalue x j ′Replace the original eigenvalue x j .
[0056] 3.2.1.2.3.4 Let j=j+1. If j≤M2, go to 3.2.1.2.3.2; otherwise go to 3.2.1.2.4.
[0057] 3.2.1.2.4. Let i=i+1. If i≤T1, go to 3.2.1.2.2. Otherwise, obtain the standardized feature data set S21' and go to 3.2.1.3.
[0058] 3.2.1.3 Combine S21' and S22 to obtain the standardized feature dataset S2'.
[0059] 3.2.2 Perform one-hot encoding on the T2 classification feature data of M2 patients in S2' (see the literature "LIANG Jie, et al. One-hot encoding and convolutional neural network based anomaly detection [J]. Journal of Tsinghua University (Science and Technology), 2019, 59 (7): 523-529." Liang Jie et al. Anomaly detection based on one-hot encoding and convolutional neural network) to obtain the preprocessed data set S3, which also contains M2 samples of patients with one-hot encoding. Send S3 to the feature engineering module.
[0060] In the fourth step, the feature engineering module uses statistical methods and machine learning methods to perform feature engineering on the preprocessed data set S3 to construct two training sets and two test sets for the training model.
[0061] 4.1 Feature Engineering Module Use statistical methods to perform feature engineering on S3 to obtain the first data set pv_data, which contains t1 features. pv_data is divided into the first training set pv_train and the first test set pv_test. pv_train contains M' patients, and pv_test contains M" patients. M'+M"=M2. The method is:
[0062] 4.1.1 S3 was divided into two groups according to the label of whether the patients responded to methylene blue, namely, the responding group and the non-responding group.
[0063] 4.1.2 Based on the hypothesis test method (see the document "Jia Junping, et al. Statistics [M]. Beijing: China Renmin University Press, 2018" p156~p184 of the work of Jia Junping et al.: Statistics), the intergroup difference analysis of each feature of the response group and the non-response group was performed. The hypothesis test methods used in the present invention include the chi-square test method, the independent sample t-test method and the Wilcoxon rank sum test method. When performing the test, it is necessary to calculate the P value to judge the result of the hypothesis test. Specifically, the chi-square test method is used to compare the difference between the categorical characteristics of the response and non-response groups (calculate the P value, and judge whether the difference between the categorical characteristics of the response and non-response groups is significant according to the P value). For continuous characteristics, for continuous characteristics that conform to the normal distribution, the independent sample t-test method is used to compare the difference between the response and non-response groups (calculate the P value), and for continuous characteristics that do not conform to the normal distribution, the Wilcoxon rank sum test method is used to compare the difference between the response and non-response groups (calculate the P value). In statistics, it is generally believed that features with a P value <0.05 have significant differences between two groups. However, due to the small number of septic shock patients treated with methylene blue, the data set of the present invention is usually small, resulting in some important factors that may not be significant. In order to effectively avoid missing some important factors, it is necessary to reset the P value (see the document "Kang SJ, et al. Predictors for functionally significant in-stent restenosis: an integrated analysis using coronaryangiography, IVUS, and myocardial perfusion imaging [J]. JACC Cardiovasc Imaging, 2013, 6 (11): 1183-1190." Kang SJ et al. Predictors for functionally significant in-stent restenosis: a comprehensive analysis using coronary angiography, IVUS and myocardial perfusion imaging), and include as many variables as possible. After many experiments, it was found that by screening features with a P value <0.3, it is possible to effectively avoid missing some important factors, so the P value is set to <0.3.
[0064] 4.1.3 The Pearson correlation coefficient test is used to explore the correlation between the features screened in 4.1.2. After removing redundant features, the first data set pv_data is obtained, which contains t1 features.
[0065] 4.1.4 Divide pv_data into the first training set pv_train and the first test set pv_test in a ratio of 3:1, send pv_train to the model training submodule in the response prediction module, and send pv_test to the model screening submodule in the response prediction module.
[0066] 4.2 Feature Engineering Module Use machine learning methods to perform feature engineering on S3 to obtain the data set ml_data for final modeling. ml_data contains t2 features. ml_data is divided into a second training set ml_train and a second test set ml_test. ml_train contains MM' patients and ml_test contains MM" patients. MM'+MM"=M2. The method is:
[0067] 4.2.1 Using random forest as the base model, the recursive feature elimination and cross validation (RFECV) method (see the literature “Staartjes VE, et al. Foundations of feature selection in clinical prediction modeling [C]. 2022” Staartjes VE et al.’s paper: Foundations of feature selection in clinical prediction modeling) was used to screen the features of S3. By gradually removing features and using cross-validation to determine the optimal feature subset, the data set ml_data for final modeling was obtained, which contained t2 features.
[0068] 4.2.2 Divide ml_data into the second training set ml_train and the second test set ml_test in a ratio of 3:1, send ml_train to the model training submodule in the response prediction module, and send ml_test to the model screening submodule in the response prediction module.
[0069] In the fifth step, the model training submodule in the response prediction module uses the first training set pv_train and the second training set ml_train to train five machine learning models respectively to obtain 10 response prediction models.
[0070] 5.1 Using the model training method, the first training set pv_train was used to train the LR model, RF model, EBM model, SVM model and LightGBM model. In order to obtain the best model performance, the grid search and 5-fold cross-validation methods were used to adjust the model's hyperparameter combination, and 5 response prediction models based on the first training set were obtained, as follows:
[0071] 5.1.1 The first training set pv_train is used to train the LR model. The grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_LR.
[0072] 5.1.2 The first training set pv_train is used to train the RF model. The grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_RF.
[0073] 5.1.3 Use the first training set pv_train to train the EBM model, use grid search and 5-fold cross-validation methods to adjust the model's hyperparameter combination, and use the model's accuracy as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_EBM.
[0074] 5.1.4 Use the first training set pv_train to train the SVM model, use grid search and 5-fold cross-validation methods to adjust the model's hyperparameter combination, and use the model's accuracy as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_SVM.
[0075] 5.1.5 Use the first training set pv_train to train the LightGBM model, use grid search and 5-fold cross-validation methods to adjust the model's hyperparameter combination, and use the model's accuracy as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_LightGBM.
[0076] 5.2 Using the model training method described in 5.1, the LR model, RF model, EBM model, SVM model and LightGBM model are trained using the second training set ml_train to obtain 5 response prediction models based on the second training set, namely ml_LR, ml_RF, ml_EBM, ml_SVM and ml_LightGBM.
[0077] 5.3 Send 5 response prediction models established based on the first training set and 5 response prediction models established based on the second training set to the model screening submodule.
[0078] In the sixth step, the model screening submodule uses the first test set pv_test and the second test set ml_test to evaluate the 10 response prediction models and screen out the best model as the final response prediction model.
[0079] 6.1 Initialize the confusion matrix A (a 2×2 table) to be empty. The confusion matrix A contains 4 elements, namely a 11, a 12 , a 21 , a 22 , are initially 0. 11 Stores the number of cases where the model predicts the label to be 1 and the actual label is also 1 (true positive) TP, a 12 Stores the number of FPs where the model predicts the label to be 1 and the true label to be 0 (false positive), a 21 Stores the number of FN where the model predicts the label to be 0 and the actual label to be 1 (false negative), a 22 Stores the number TN of cases where the model predicts the label to be 0 and the actual label is 0 (true negative).
[0080] Confusion Matrix A
[0081]
[0082] 6.2 Based on the first test set pv_test, the five response prediction models based on the first training set obtained in 5.1 are evaluated using the response prediction model evaluation method to obtain an optimal response prediction model based on the first training set. The method is:
[0083] 6.2.1 Based on the first test set pv_test, the eight evaluation indicators of the five response prediction models, including accuracy (ACC), sensitivity (Sensitivity), specificity (Specificity), F1Score, positive predictive value (PPV), negative predictive value (NPV), AUC value, and Brier score, were calculated respectively.
[0084] 6.2.1.1 Calculate the eight evaluation indicators of the pv_LR model using the indicator calculation method:
[0085] 6.2.1.1.1 Input the M” patients in the first test set into the pv_LR model established in 5.1.1. The pv_LR prediction model outputs the results of the M” patients’ responses to the methylene blue drug (1 for response, 0 for no response), as well as the probability values of the M” patients’ responses to the methylene blue drug. By counting the actual labels and the predicted labels, the confusion matrix A in 6.1 is filled to obtain the filled confusion matrix A, i.e., a 11 =TP,a 12 =FP,a 21 =FN,a 22 =TN, and the filled confusion matrix table A is obtained as shown in Table 2:
[0086] The confusion matrix A after padding
[0087]
[0088] Among them, TP represents the number of patients who were correctly predicted as responding to methylene blue by the pv_LR model among M” patients who actually responded; FP represents the number of patients who were incorrectly predicted as responding to methylene blue by the pv_LR model among M” patients who actually did not respond to methylene blue; FN represents the number of patients who were incorrectly predicted as not responding to methylene blue by the pv_LR model among M” patients who actually responded to methylene blue; TN represents the number of patients who were correctly predicted as not responding to methylene blue by the pv_LR model among M” patients who actually did not respond to methylene blue, TP+TN+FP+FN=M”.
[0089] 6.2.1.1.2 Based on the filled confusion matrix A, calculate 8 evaluation indicators:
[0090] 6.2.1.1.2.1 Calculate the accuracy (ACC): the ratio of the number of samples correctly predicted by the classification model to the total number of samples:
[0091]
[0092] 6.2.1.1.2.2 Calculate Sensitivity: The ratio of the number of samples correctly predicted as positive by the classification model to the number of all positive samples:
[0093]
[0094] 6.2.1.1.2.3 Calculate specificity: the ratio of the number of samples correctly predicted as counterexamples by the classification model to the number of all counterexample samples:
[0095]
[0096] 6.2.1.1.2.4 Calculate F1-score F1Score: The harmonic mean of precision and recall:
[0097]
[0098] 6.2.1.1.2.5 Calculate the positive predictive value (PPV): the proportion of samples predicted by the classification model to be positive that are actually positive:
[0099]
[0100] 6.2.1.1.2.6 Calculate the negative predictive value (NPV): the proportion of samples predicted by the classification model to be negative examples that are actually negative examples:
[0101]
[0102] 6.2.1.1.2.7 Calculate AUC (Area Under Curve): The area under the receiver operating characteristic curve (ROC curve). The ROC curve is a curve drawn based on a series of different binary classification methods (cutoff values or decision thresholds) with the true positive rate (sensitivity) as the ordinate and the false positive rate (1-specificity) as the abscissa. The calculation formula is:
[0103]
[0104] 6.2.1.1.2.8 Calculate the Brier Score: It measures the gap between the model prediction results and the actual results in the classification problem. The value range is between 0 and 1. The smaller the value, the higher the prediction accuracy of the model.
[0105]
[0106] Among them, M" represents the sample size in pv_test, f j is the predicted probability of the response prediction model for patient j in pv_test, o j is the actual class label of patient j in pv_test, usually 0 or 1.
[0107] 6.2.1.2 Use the indicator calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_RF model:
[0108] 6.2.1.3 Use the index calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_EBM model:
[0109] 6.2.1.4 Use the indicator calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_SVM model:
[0110] 6.2.1.5 Use the indicator calculation method described in step 6.2.1.1 to calculate the 8 evaluation indicators of the pv_LightGBM model:
[0111] 6.2.2 The accuracy, sensitivity, specificity, F1Score, positive predictive value (PPV), negative predictive value (NPV), and AUC values are all better as the larger they are, and the smaller the Brier score is, the better. The performance of the five models is evaluated based on these eight evaluation indicators. Among the five models, if the number of these indicators that reach the optimal value is the same, the model with better Accuracy and AUC values is preferred, and the best response prediction model based on the first training set among the five models obtained in 5.1 is obtained, referred to as the first best model.
[0112] 6.3 Based on the second test set ml_test, the response prediction model evaluation method described in step 6.2 is used to evaluate the five response prediction models based on the second training set obtained in step 5.2 to obtain an optimal response prediction model based on the second training set, referred to as the second optimal model.
[0113] 6.4 Based on the first training set pv_test, three visualization curves (ROC curve, calibration curve, clinical decision curve DCA) of the first best model are drawn, and based on the second training set ml_test, three visualization curves of the second best model are drawn. Compare the performance of the first best model and the second best model in the three visualization curves, and select the model with a larger number of better performances in the visualization curves, which is the final response prediction model. Send the final response prediction model and the training set used by it (the training set contains t features, t = t1 or t2) to the model interpretation submodule.
[0114] In the seventh step, the model interpretation submodule uses the SHAP interpreter (see the document "JIA Xiao-yao,. Breast Cancer Prediction and Feature Analysis Model Based on CatBoost and SHAP [J]. Computer and Modernization, 2023, 0 (10): 32-38." Jia Xiaoyao's paper: Breast Cancer Prediction and Feature Analysis Based on CatBoost and SHAP) to perform global and local interpretation on the final response prediction model to obtain the final prediction model and an interpretable prediction system for the response of patients with septic shock to methylene blue treatment.
[0115] 7.1 The model interpretation submodule is a SHAP interpreter implemented by a "model interpretation package" shap developed in Python. When using it, you need to install the shap package first and import the SHAP library through the import shap statement.
[0116] 7.2 Use the "shap.Explainer" class to initialize the SHAP interpreter, input the training set used by the final response prediction model and the final response prediction model into the SHAP interpreter, complete the initialization of the SHAP interpreter, and obtain the initialized SHAP interpreter.
[0117] 7.3 Calculate the SHAP values of the t features in the training set used by the final response prediction model through the "shap_values" function in the SHAP interpreter, and calculate the average values avg_shap_1,..., avg_shap_f,..., avg_shap_t of the absolute values of the SHAP values of the t features in the training set used by the final response prediction model, where f is a positive integer and 1 ≤ f ≤ t.
[0118] 7.4 Conduct a global interpretation of the final response prediction model, using avg_shap_1,..., avg_shap_f,..., avg_shap_t as the importance degrees of the t features for the methylene blue drug response prediction. Obtain a ranking plot of the importance of the t features for the model prediction through the "summary_plot" visualization function in the SHAP interpreter. Find the features in avg_shap_1,..., avg_shap_f,..., avg_shap_t that are less than the threshold threshold (threshold is selected according to the feature importance distribution, threshold = (avg_shap_1 +... + avg_shap_f +... + avg_shap_t) / (2 × t)). Let the number of features in avg_shap_1,..., avg_shap_f,..., avg_shap_t that are less than threshold be t3. Then these t3 features are the key features for the methylene blue drug response, t3 < t, and t3 is a positive integer.
[0119] 7.5 Conduct a local interpretation of the final response prediction model, that is, explain how the t features affect the prediction result of the model for a single patient. Through the "waterfall" visualization function in the SHAP interpreter, visualize the SHAP values of the t features of any patient (denoted as X1) calculated in step 7.3 to generate a waterfall plot of X1. In the waterfall plot of X1, E[f(X1)] represents the initial prediction deviation of the model (the average result predicted by the model without any feature information), f(X1) represents the predicted output value of the model for the given sample X1, and the influence of each feature on the model output is shown in the form of a bar chart. The red bars indicate that the feature has a positive effect on the prediction, and the blue bars indicate that the feature has a negative effect on the prediction. The height of the bar chart of each feature represents the magnitude of the influence of the feature on the model output. The waterfall plot of X1 shows the contributions of each feature to the response prediction result of patient X1.
[0120] 7.6 The final response prediction model and the initialized SHAP interpreter together constitute the final prediction model in the response prediction module, and at this time, the best interpretable prediction system for the methylene blue treatment response of septic shock patients is obtained.
[0121] In the eighth step, the final interpretable prediction system for the response of septic shock patients to methylene blue treatment predicts the patient data X input by the user to obtain the prediction result, and the method is:
[0122] 8.1 The data preprocessing module preprocesses the patient data X input by the user by:
[0123] 8.1.1 Perform data cleaning on X. Check whether there are missing values or outliers in the features of X. If there are, use the average value of the feature in the training set of the final response prediction model to fill in the missing values or outliers, and obtain the cleaned data X'.
[0124] 8.1.2 Perform data transformation on X'. For continuous features in X, based on the mean and variance of the corresponding features in the training set of the final response prediction model, use the Z-Score standardization method to standardize the features to obtain the standardized data X". Perform one-hot encoding on the categorical features in X", obtain the pre-processed septic shock patient data X"', and send X"' to the prediction model in the response prediction module.
[0125] 8.2 The final response prediction model in the prediction model of the response prediction module predicts X'' and obtains the prediction result of whether the patient responds to the methylene blue drug (response or no response).
[0126] 8.3 The SHAP interpreter in the prediction model of the response prediction module calculates the SHAP value of each feature in X'' for the prediction of the methylene blue drug response, and uses the "waterfall" visualization function described in step 7.5 to visualize the SHAP value to generate a waterfall chart of X. In the waterfall chart of X, E[f(X)] represents the initial prediction deviation of the model, f(X) represents the predicted output value of the model for X, and the impact of each feature on the model output is presented in the form of a bar chart. The red bar indicates that the feature has a positive effect on the prediction, and the blue bar indicates that the feature has a negative effect on the prediction. The waterfall chart of X shows the contribution of each feature to the patient's response prediction result, helping doctors understand and trust the model to assist doctors in making decisions about X.
[0127] The following technical effects can be achieved by using the present invention:
[0128] 1. The fourth step of the feature engineering module of the present invention comprehensively uses a variety of methods for feature engineering, constructs two sets of data sets for the clinical data set of methylene blue drug treatment response for septic shock, and divides them into training sets and test sets respectively. The feature engineering module can screen out more relevant features, thereby improving the performance and accuracy of model prediction. Methylene blue is used as a second-line pressor for the treatment of patients with septic shock, so the data set for this study is usually small, and too many features may cause the problem of model overfitting. The feature engineering module uses a variety of methods for feature engineering, avoids the model's excessive reliance on a single feature engineering method, reduces the risk of model overfitting, and thus improves the generalization ability of the model.
[0129] 2. The fifth step of the present invention uses five different machine learning models to predict drug treatment response. By comparing the prediction results of different models, the model with the best performance is selected, and the SHAP (SHapley Additive exPlanations) interpreter is introduced to explain the optimal machine learning model. On the one hand, the robustness of the model can be enhanced and the accuracy of the prediction can be improved; on the other hand, the interpreter can be used to explore the potential influencing factors of the response of septic shock patients to methylene blue drug treatment, which helps doctors understand the prediction process and results of the model, enhance doctors' trust in the prediction model, and promote the discovery of new treatment methods.
[0130] 3. In clinical practice, whether methylene blue is used to increase blood pressure in patients with septic shock mainly depends on the experience of doctors, which is relatively subjective. The first step of the present invention constructs a prediction system for the response of septic shock patients to methylene blue treatment. In the data of the hospital in the embodiment, a good prediction effect is achieved, and the overall accuracy of predicting the patient's response to methylene blue reaches 76%, among which the accuracy of predicting the patient's non-response to methylene blue reaches 94%. It can accurately identify patients who are non-responsive to methylene blue and reduce the risk caused by the incorrect use of the drug. Applying this prediction model in clinical practice can help better identify septic shock patients who benefit from methylene blue drugs, help optimize the treatment plan of the disease, explore the pathophysiological mechanism, and improve clinical practice. BRIEF DESCRIPTION OF THE DRAWINGS
[0131] Figure 1 It is the overall flow chart of the present invention.
[0132] Figure 2 This is a logical structure diagram of the methylene blue treatment response prediction system for septic shock patients constructed in the first step of the present invention.
[0133] Figure 3 These are three visualization curves of the two best models in steps 6.2 and 6.3 drawn based on two test sets in the embodiment.
[0134] in Figure 3 (a) is the ROC curve of the first best model drawn based on the first test set pv_test, Figure 3 (b) is the ROC curve of the second best model drawn based on the second test set ml_test. Figure 3 (c) is a calibration curve of the first best model drawn based on the first test set pv_test, Figure 3 (d) is the calibration curve of the second best model drawn based on the second test set ml_test. Figure 3 (e) is the DCA curve of the first best model drawn based on the first test set pv_test, Figure 3 (f) is the DCA curve of the second best model drawn based on the second test set ml_test.
[0135] Figure 4 It is a waterfall chart of X1 generated in step 7.5 of the embodiment.
[0136] Figure 5 This is the waterfall chart obtained by inputting patient X into the final prediction model in step 8.3 of the embodiment.
[0137] Figure 6 It is a ranking diagram of the relative importance of the contribution of each feature to the overall prediction of the final prediction model in the embodiment. DETAILED DESCRIPTION
[0138] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0139] The experimental environment of an embodiment of the present invention is Windows 11, equipped with an Intel i5-12400 series CPU, a processing frequency of 2.50 GHz, and a memory of 16G. Figure 1 As shown, this embodiment includes the following steps:
[0140] The first step is to build a prediction system for the response of patients with septic shock to methylene blue treatment. Figure 2 As shown, the methylene blue treatment response prediction system for septic shock patients consists of a data preprocessing module, a feature engineering module, and a response prediction module. Each module is based on the Python language (version 3.9 is used in this embodiment) and developed using the PyCharm integrated development environment (version 2022.1.3). Multiple Python libraries are used in the implementation process, including scikit-learn, pandas, matplotlib, missingno, numpy, scipy, interpret, lightgbm, and shap.
[0141] The data preprocessing module is connected to the feature engineering module. During training, the data preprocessing module reads the original data set S1 (S1 consists of 24 features) input by the user, performs data cleaning on the features in S1, and obtains the cleaned data set S2; then performs data transformation on S2, first standardizes the continuous features in S2, obtains the standardized data set S2', and then performs unique hot encoding on the categorical features in S2' to obtain the preprocessed data set S3, and sends S3 to the feature engineering module. When predicting the septic shock patient data X input by the user, X is cleaned to obtain the cleaned data X', and then X' is transformed to obtain the preprocessed septic shock patient data X"', and X"' is sent to the response prediction module.
[0142] The feature engineering module is connected to the data preprocessing module and the response prediction module. The present invention adopts two methods to perform feature engineering on S3, one is based on the statistical method commonly used in clinical research, and the other is based on the machine learning method. During training, the feature engineering module receives the data set S3 input by the data preprocessing module, first uses the statistical method to screen the significant features, obtains the first data set pv_data, and divides pv_data into the first training set pv_train and the first test set pv_test. Then, the machine learning method is used to perform feature screening on S3 to obtain the second data set ml_data, and ml_data is divided into the second training set ml_train and the second test set ml_test. The first training set pv_train, the first test set pv_test, the second training set ml_train, and the second test set ml_test are sent to the response prediction module.
[0143] The response prediction module is connected to the feature engineering module and the data preprocessing module. The response prediction module consists of a model training submodule, a model screening submodule, a model interpretation submodule, and a prediction model. The model training submodule is connected to the feature engineering module and the model screening submodule, and includes a logistic regression model (LR), a random forest model (RF), a support vector machine model (SVM), an explainable boosting machine model (EBM), and a light gradient boosting machine model (LightGBM). During training, the model training submodule receives the first training set pv_train input by the feature engineering module, trains 5 models, and adjusts the hyperparameters of the 5 models to obtain 5 response prediction models. The model training submodule also receives the second training set ml_train input by the feature engineering module, trains 5 models, and adjusts the hyperparameters of the 5 models to obtain 5 response prediction models. After training, a total of 10 response prediction models are obtained, and the 10 response prediction models are sent to the model screening submodule.
[0144] The model screening submodule is connected to the feature engineering module, the model training submodule, and the model interpretation submodule. During training, the model screening submodule receives 10 response prediction models input by the model training submodule, and when receiving the first test set pv_test input by the feature engineering module, the 5 response prediction models established based on the first training set pv_train are evaluated; when receiving the second test set ml_test input by the feature engineering module, the 5 response prediction models established based on the second training set ml_train are evaluated, and the 10 response prediction models received from the model training submodule are evaluated to obtain the best response prediction model. The best response prediction model and the data set used by it are sent to the model interpretation submodule (for example, if the best response prediction model is an SVM model established based on the first training set pv_train, the first training set pv_train and the SVM model are sent together to the model interpretation submodule).
[0145] The model interpretation submodule is connected to the model screening submodule. During training, the model interpretation submodule receives the best response prediction model and the data set used by it input by the model screening submodule, inputs them into the SHAP interpreter, and uses the SHAP interpreter to perform global interpretation (obtaining the importance of each feature to the prediction of methylene blue drug response) and local interpretation (obtaining how each feature affects the prediction model's prediction of a single patient) of the best response prediction model.
[0146] The best response prediction model and SHAP interpreter together constitute the final prediction model obtained through training. When predicting the single septic shock patient data X input by the user, the prediction model receives the "X" input by the data preprocessing module, and the best response prediction model in the prediction model outputs the prediction result of the patient's response to the methylene blue drug (response / no response). The SHAP interpreter in the prediction model outputs the SHAP value of each feature for the patient's response prediction result, and visualizes these SHAP values, so that you can intuitively understand the contribution of each feature to the patient's response prediction result.
[0147] The second step is to construct the original dataset S1 by:
[0148] 2.1 Initialize the original data set S1 to be empty. Each table entry of S1 includes 26 fields, namely the patient ID number (unique), 24 features for building the model, and the label of whether the patient responds to the methylene blue drug.
[0149] 2.2 The ID numbers of patients who met the following three conditions were extracted from the hospital's sepsis database: (1) diagnosed with septic shock; (2) aged ≥18 years; (3) receiving methylene blue as a second-line vasopressor (methylene blue was started at least 6 hours after the patient received norepinephrine infusion). If the patient used methylene blue to increase blood pressure multiple times, only those with a time interval of more than 6 hours from the second use of methylene blue were included in S1.
[0150] This example collects septic shock patients who used methylene blue to increase blood pressure from June 2018 to October 2022 in the sepsis database of Xiangya Hospital of Central South University. Methylene blue is used for patients who have received norepinephrine pumping with a dosage of ≥ 0.5ug / kg.min after adequate fluid resuscitation. The usage is methylene blue 2mg / kg, added to 100ml of normal saline, and intravenously dripped for 20 to 30 minutes. At this time, there are 579 patient ID numbers in S1.
[0151] The patient ID numbers that meet one of the following conditions are deleted from S1: (1) The ICU stay after using methylene blue is less than 24 hours; (2) It is unclear whether methylene blue is used to increase blood pressure and the effectiveness cannot be judged due to missing data. At this time, there are M = 416 patient ID numbers in S1, that is, at this time, S1 has a total of 416 table items, and 1 table item corresponds to 1 patient sample.
[0152] 2.3 According to the patient ID number in S1, 24 features for model construction were extracted from the sepsis database of Xiangya Hospital, including patient gender, age at hospitalization (years), weight (kg), smoking history, drinking history, comorbidities (hypertension, diabetes, coronary heart disease, atrial fibrillation, lung disease, kidney disease, liver disease, immune suppression), ICU type (central ICU and other ICUs), whether terlipressin was used, whether hormones were used, and the average norepinephrine equivalent (NEE) 6 hours before starting methylene blue. pre ), oxygen therapy method (invasive ventilator-assisted breathing and non-invasive assisted breathing), oxygenation index (OI), whether continuous renal replacement therapy (CRRT), lactate, central venous oxygen saturation (ScvO2), time from the start of methylene blue to the first start of norepinephrine (T NE ), the time from the start of methylene blue to the diagnosis of shock (T shock ), put these contents into the table corresponding to the patient id number of S1. The above 24 features are divided into continuous features and categorical features. Continuous features include the patient's age (years), weight (kg), NEE pre , OI, lactate, ScvO2, T NE 、T shock The classification characteristics include patient gender, smoking history, drinking history, hypertension, diabetes, coronary heart disease, atrial fibrillation, lung disease, kidney disease, liver disease, immune suppression, ICU type, whether terlipressin is used, whether hormones are used, oxygen therapy method, and whether continuous renal replacement therapy is used.
[0153] The calculation formula of norpinephrine equivalent (NEE) is: NEE = Norepinephrine dose (μg / kg / min) + 1 / 100 × dopamine dose (μg / kg / min) + 0.06 × phenylephrine dose (μg / kg / min) + 10 × terlipressin dose (μg / kg / min) + 0.2 × methylene blue dose (mg / kg / h) + 8 × metaraminol dose (μg / kg / min) + 0.02 × hydroxocobalamin vitamin B12 dose (g) + 0.4 × midodrine dose (μg / kg / min). The average norpinephrine equivalent (NEE) 6 hours before starting methylene blue pre ) is used to calculate the amount of NEE used within 6 hours before starting methylene blue (assuming that all drugs are used at a uniform rate).
[0154] 2.4 Based on the following conditions, the labels of whether the 416 patients in S1 responded to methylene blue were obtained (the label was 1 if there was a response, and the label was 0 if there was no response).
[0155] Patients who responded to methylene blue (i.e., effective pressor) were defined as meeting one of the following two conditions: (1) NEE decreased by >10% (i.e., NEE% <-10%) and mean arterial pressure (MAP_avg_post) ≥65 mmHg; (2) NEE decreased, remained unchanged, or increased by <10% (i.e., 10% > NEE% ≥-10%) but mean arterial pressure change (MAP_avg%) increased by ≥10 mmHg. Specifically, when one of the above two conditions was met, methylene blue pressor was considered effective, and the label corresponding to the patient ID number in S1 was assigned a value of 1. When both conditions were not met, methylene blue pressor was defined as ineffective, and the label corresponding to the patient ID number in S1 was assigned a value of 0.
[0156] Where, the change value of NEE (NEE%) = (NEE post -NEE pre ) / NEE pre ×100%,NEE post The average amount of methylene blue (same as NEE) is 6 hours after the start of methylene blue pre It can be calculated by the formula). Mean arterial pressure (MAP) = [systolic pressure + (diastolic pressure × 2)] / 3. The normal value of mean arterial pressure for normal adults is 70-105 mmHg. The average value of mean arterial pressure (MAP_avg) within 6 hours before and after the start of methylene blue is calculated to obtain MAP_avg_pre and MAP_avg_post. The change value of MAP_avg (MAP_avg%) = (MAP_avg_post-MAP_avg_pre). At this time, the number of patients who responded in S1 is M_1 = 159, and the number of patients who did not respond is M_0 = 257.
[0157] In the third step, the data preprocessing module preprocesses the data set S1 to obtain the preprocessed data set S3.
[0158] 3.1 Clean up the data of S1 by:
[0159] 3.1.1 Use a boxplot to detect outliers (wrongly recorded data values or abnormal data values) in S1, delete the outliers or fill them with the average value of the feature to obtain the data set S1'. Because there are no outliers in S1 at this time, there are a total of M2=M=416 patient id numbers in S1'.
[0160] 3.1.2 Delete the ScvO2 feature with a data missing ratio of more than 30% in S1'. For the features with a data missing ratio of <30% (oxygenation index OI and lactate), use the multiple KNN interpolation method for interpolation. The specific steps are:
[0161] 3.1.2.1 Split S1' into a part S11 with missing values and a complete part S12. S11 is the feature that needs to be interpolated.
[0162] 3.1.2.2 Interpolate S11 to obtain K (K is set to 20 in this embodiment) interpolated data sets S111, ..., S11 k , …, S11 K (1≤k≤K and k is a positive integer), S111,…, S11 k , …, S11 K The number of patient IDs in the dataset is 416. The difference from S11 is that the features with missing data ratio <30% have been imputed, and there are no features with missing data ratio ≥30%. k , …, S11 K Randomly divide the training set and test set and perform model training and evaluation to obtain avg_accuracy1, ..., avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K ,avg_accuracy k For S11 k Evaluation indicator average accuracy, avg_rmse k For S11 k The evaluation indicator of is the average root mean square error; the specific process is:
[0163] 3.1.2.2.1 Let k = 1;
[0164] 3.1.2.2.2 Perform the k-th KNN interpolation on the missing values of each feature in S11:
[0165] 3.1.2.2.2.1 Calculate the distance between the samples with missing feature values in S11 and each sample in S12;
[0166] 3.1.2.2.2.2 Select the k samples with the closest distance;
[0167] 3.1.2.2.2.3 For continuous features in S11, fill missing values by calculating the average value of k samples by weighted average; for categorical features in S11, fill missing values by voting to select the most frequent category in the categorical features, and obtain the interpolated S11';
[0168] 3.1.2.2.2.4 Combine the interpolated S11' and S12 to obtain the k-th interpolated dataset S11 k .
[0169] 3.1.2.2.3 For S11 k Perform N (N is set to 20 in the embodiment) evaluations to obtain N pairs of S11 k The evaluation indicators are accuracy-1, ..., accuracy-n, ..., accuracy-N and N root mean square errors rmse-1, ..., rmse-n, ..., rmse-N (1≤n≤N and n is a positive integer); accuracy-n is the nth evaluation of S11 k The evaluation index accuracy, rmse-n is the nth time for S11 k The evaluation indicator root mean square error is:
[0170] 3.1.2.2.3.1Let n = 1;
[0171] 3.1.2.2.3.2 For S11 k Randomly divide the data in a ratio of 3:1 to obtain the training set n_train and the test set n_test (each division is random, and the obtained n_train and n_test are different);
[0172] 3.1.2.2.3.3 Train the random forest model based on n_train, evaluate the established random forest model based on n_test, and calculate the accuracy accuracy-n and the root mean square error rmse-n of the random forest model after the nth training;
[0173] 3.1.2.2.3.4 Let n = n + 1. If n ≤ 20, go to 3.1.2.2.3.2 to continue randomly dividing the training set and test set and performing model training and evaluation. Otherwise, after obtaining accuracy-1, …, accuracy-n, …, accuracy-N and rmse-1, …, rmse-n, …, rmse-N, go to 3.1.2.2.4.
[0174] 3.1.2.2.4 Calculate the average of accuracy-1, ..., accuracy-n, ..., accuracy-N and get S11 kThe average accuracy avg_accuracy k , calculate the average of rmse-1, ..., rmse-n, ..., rmse-N, and get S11 k The average root mean square error avg_rmse k ;
[0175] 3.1.2.2.5 Let k = k + 1. If k ≤ 20, go to 3.1.2.2.2. Otherwise, get avg_accuracy1, ..., avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K , go to 3.1.2.3.
[0176] 3.1.2.3 Comparison of avg_accuracy1, …, avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K (The results of this embodiment are shown in Table 1), select average accuracy avg_accuracy k Maximum and average root mean square error avg_rmse k The data set S118 corresponding to the relatively small k value (k=8 in this embodiment) is used as the cleaned data set S2. S2 has a total of T=23 features, of which T1=7 are continuous features (including the patient's age (years), weight (kg), NEE pre , OI, lactic acid, T NE 、T shock ), and the classification characteristics include T2=16 (including patient gender, smoking history, drinking history, hypertension, diabetes, coronary heart disease, atrial fibrillation, lung disease, kidney disease, liver disease, immune suppression, ICU type, whether terlipressin is used, whether hormone is used, oxygen therapy method, and whether continuous renal replacement therapy is used).
[0177] Table 1: 20 evaluations S11 obtained in step 3.1.2.2 k avg_accuracy k and avg_rmse k
[0178]
[0179] 3.2 Transform the data of S2 by:
[0180] 3.2.1 The 7 continuous feature data of 416 patients in S2 were standardized using the Z-Score standardization method (the categorical feature data were not processed) to obtain the standardized data set S2'. The method is:
[0181] 3.2.1.1 S2 is divided into a part S21 containing 7 continuous feature data and a part S22 containing 16 categorical feature data.
[0182] 3.2.1.2 Standardize the features in S21 to obtain the standardized data set S21', the method is:
[0183] 3.2.1.2.1 Let variable i = 1 (i value ranges from 1 to 7, i is a positive integer):
[0184] 3.2.1.2.2 Calculate the mean μ of the i-th continuous feature in S21 i and standard deviation σ i ;
[0185] 3.2.1.2.3 The data of the ith continuous feature of 416 patients in S21 is standardized to obtain the values of 416 standardized ith continuous features, the method is:
[0186] 3.2.1.2.3.1 Let variable j = 1 (the value of j ranges from 1 to 416, j is a positive integer):
[0187] 3.2.1.2.3.2 The characteristic value x of the jth patient for the i-th continuous characteristic j Standardize and get x j ′, the calculation formula is:
[0188]
[0189] Among them, x j is the original eigenvalue of the jth patient, x j ′ is the normalized eigenvalue.
[0190] 3.2.1.2.3.3 Using the standardized eigenvalue x j ′Replace the original eigenvalue x j .
[0191] 3.2.1.2.3.4 Let j=j+1. If j≤416, go to 3.2.1.2.3.2; otherwise go to 3.2.1.2.4.
[0192] 3.2.1.2.4 Let i=i+1. If i≤7, go to 3.2.1.2.2. Otherwise, obtain the standardized feature data set S21' and go to 3.2.1.3.
[0193] 3.2.1.3 Combine S21' and S22 to obtain the standardized feature dataset S2'.
[0194] 3.2.2 Perform one-hot encoding on the 16 categorical feature data of 416 patients in S2' to obtain the preprocessed data set S3, which also contains 416 one-hot encoded patient samples. Send S3 to the feature engineering module.
[0195] In the fourth step, the feature engineering module uses statistical methods and machine learning methods to perform feature engineering on the preprocessed data set S3 to construct two training sets and two test sets for the training model.
[0196] 4.1 Feature Engineering Module Use statistical methods to perform feature engineering on S3 to obtain the first training set pv_train and the first test set pv_test. pv_train contains M'=312 patients and pv_test contains M"=104 patients. The method is:
[0197] 4.1.1 S3 was divided into two groups according to the label of whether the patients responded to methylene blue, namely, the responding group and the non-responding group.
[0198] 4.1.2 Intergroup difference analysis of each feature of the response group and the non-response group was performed based on the hypothesis test method. The present embodiment uses the chi-square test method to compare the difference between the categorical features in the response and non-response groups (calculate the P value, and judge whether the difference between the categorical features in the response and non-response groups is significant according to the P value). For continuous features, the independent sample t-test method is used to compare the difference between the response and non-response groups for continuous features that conform to the normal distribution (calculate the P value), and the Wilcoxon rank sum test method is used to compare the difference between the response and non-response groups for continuous features that do not conform to the normal distribution (calculate the P value). The present invention selects to screen out the features with P value <0.3, and the screened variables are shown in Table 2.
[0199] Table 2: Features screened using statistical methods
[0200]
[0201] 4.1.3 The Pearson correlation coefficient test was used to explore the correlation between the features selected in 4.1.2. After removing redundant features, the first data set pv_data was obtained. pv_data contains t1 = 10 features, namely, whether terlipressin is used, ICU type, whether liver disease, whether atrial fibrillation, oxygen therapy method, OI, smoking history, T NE 、T shock 、NEEpre .
[0202] 4.1.4 Divide pv_data into the first training set pv_train (including 312 patients, including 126 responding patients and 186 non-responding patients) and the first test set pv_test (including 104 patients, including 33 responding patients and 71 non-responding patients) in a ratio of 3:1, send pv_train to the model training submodule in the response prediction module, and send pv_test to the model screening submodule in the response prediction module.
[0203] 4.2 Feature Engineering Module Use machine learning methods to perform feature engineering on S3 to obtain the second training set ml_train and the second test set ml_test. ml_train contains MM' = 312 patients and ml_test contains MM" = 104 patients. The method is:
[0204] 4.2.1 Using random forest as the base model, the recursive feature elimination and cross validation (RFECV) method is used to screen the features of S3. By gradually removing features and using cross validation to determine the optimal feature subset, the data set ml_data for final modeling is obtained. ml_data contains t2=8 features, as shown in Table 3.
[0205] Table 3: Features screened using machine learning methods
[0206]
[0207] 4.2.2 Divide ml_data into the second training set ml_train (including 312 patients, including 126 responding patients and 186 non-responding patients) and the second test set ml_test (including 104 patients, including 33 responding patients and 71 non-responding patients) in a ratio of 3:1, send ml_train to the model training submodule in the response prediction module, and send ml_test to the model screening submodule in the response prediction module.
[0208] In the fifth step, the model training submodule in the response prediction module uses the first training set pv_train and the second training set ml_train to train five machine learning models respectively to obtain 10 response prediction models.
[0209] 5.1 Using the model training method, the first training set pv_train was used to train the LR model, RF model, EBM model, SVM model and LightGBM model. In order to obtain the best model performance, the grid search and 5-fold cross-validation methods were used to adjust the model's hyperparameter combination, and 5 response prediction models based on the first training set were obtained, as follows:
[0210] 5.1.1 The first training set pv_train is used to train the LR model. The grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination (as shown in the first row of Table 4) to obtain the response prediction model pv_LR.
[0211] 5.1.2 The first training set pv_train is used to train the RF model. The grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination (as shown in the second row of Table 4) to obtain the response prediction model pv_RF.
[0212] 5.1.3 The first training set pv_train is used to train the EBM model. The grid search and 5-fold cross-validation methods are used to adjust the hyperparameter combination of the model. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination (as shown in the third row of Table 4) to obtain the response prediction model pv_EBM.
[0213] 5.1.4 The first training set pv_train is used to train the SVM model. The grid search and 5-fold cross-validation methods are used to adjust the hyperparameter combination of the model. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination (as shown in the 4th row of Table 4) to obtain the response prediction model pv_SVM.
[0214] 5.1.5 The first training set pv_train is used to train the LightGBM model, and the grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination (as shown in the 5th row of Table 4) to obtain the response prediction model pv_LightGBM.
[0215] Table 4: Best hyperparameter combinations for all models
[0216]
[0217] 5.2 Adopt the model training method described in 5.1, and use the second training set ml_train to train the LR model, RF model, EBM model, SVM model and LightGBM model, and obtain 5 response prediction models based on the second training set, namely ml_LR (the best hyperparameter combination is shown in the 6th row of Table 4), ml_RF (the best hyperparameter combination is shown in the 7th row of Table 4), ml_EBM (the best hyperparameter combination is shown in the 8th row of Table 4), ml_SVM (the best hyperparameter combination is shown in the 9th row of Table 4), and ml_LightGBM (the best hyperparameter combination is shown in the 10th row of Table 4).
[0218] 5.3 Send the five response prediction models established based on the first training set and the five response prediction models established based on the second training set to the model screening submodule. The optimal hyperparameter combinations of all models in this embodiment are shown in Table 4.
[0219] In the sixth step, the model screening submodule uses the first test set pv_test and the second test set ml_test to evaluate the 10 response prediction models and screen out the best model as the final response prediction model.
[0220] 6.1 Initialize the confusion matrix A (a 2×2 table, as shown in Table 5) to be empty. The confusion matrix A contains 4 elements, namely a 11 , a 12 , a 21 , a 22 , are initially 0. 11 Stores the number of cases where the model predicts the label to be 1 and the actual label is also 1 (true positive) TP, a 12 Stores the number of FPs where the model predicts the label to be 1 and the true label to be 0 (false positive), a 21 Stores the number of FN where the model predicts the label to be 0 and the actual label to be 1 (false negative), a 22 Stores the number TN of cases where the model predicts the label to be 0 and the actual label is 0 (true negative).
[0221] Table 5: Confusion Matrix A
[0222]
[0223] 6.2 Based on the first test set pv_test, the five response prediction models based on the first training set obtained in 5.1 are evaluated using the response prediction model evaluation method to obtain an optimal response prediction model based on the first training set. The method is:
[0224] 6.2.1 Based on the first test set pv_test, the eight evaluation indicators of the five response prediction models, including accuracy (ACC), sensitivity (Sensitivity), specificity (Specificity), F1Score, positive predictive value (PPV), negative predictive value (NPV), AUC value, and Brier score, were calculated respectively.
[0225] 6.2.1.1 Calculate the eight evaluation indicators of the pv_LR model using the indicator calculation method:
[0226] 6.2.1.1.1 Input the first test set of M”=104 patients into the pv_LR model established in 5.1.1. The pv_LR prediction model outputs the results of the 104 patients’ responses to methylene blue (1 for response, 0 for no response) and the probability values of the 104 patients’ responses to methylene blue. By counting the actual labels and predicted labels, the confusion matrix A of 6.1 is filled, i.e., a 11 =TP=14,a 12 =FP=6,a 21 =FN=19,a 22 =TN=65, and the filled confusion matrix table A is obtained as shown in Table 6:
[0227] Table 6: Confusion matrix A after padding
[0228]
[0229] Among them, TP represents the number of patients who were correctly predicted as responding to methylene blue by the pv_LR model among 104 patients who actually responded; FP represents the number of patients who were incorrectly predicted as responding to methylene blue by the pv_LR model among 104 patients who actually did not respond to methylene blue; FN represents the number of patients who were incorrectly predicted as not responding to methylene blue by the pv_LR model among 104 patients who actually responded to methylene blue; TN represents the number of patients who were correctly predicted as not responding to methylene blue by the pv_LR model among 104 patients who actually did not respond, TP+TN+FP+FN=104.
[0230] 6.2.1.1.2 Based on the filled confusion matrix A shown in Table 6, calculate 8 evaluation indicators:
[0231] 6.2.1.1.2.1 Calculate the accuracy (ACC): the ratio of the number of samples correctly predicted by the classification model to the total number of samples:
[0232]
[0233] 6.2.1.1.2.2 Calculate Sensitivity: The ratio of the number of samples correctly predicted as positive by the classification model to the number of all positive samples:
[0234]
[0235] 6.2.1.1.2.3 Calculate specificity: the ratio of the number of samples correctly predicted as counterexamples by the classification model to the number of all counterexample samples:
[0236]
[0237] 6.2.1.1.2.4 Calculate F1-score F1Score: The harmonic mean of precision and recall:
[0238]
[0239] 6.2.1.1.2.5 Calculate the positive predictive value (PPV): the proportion of samples predicted by the classification model to be positive that are actually positive:
[0240]
[0241] 6.2.1.1.2.6 Calculate the negative predictive value (NPV): the proportion of samples predicted by the classification model to be negative examples that are actually negative examples:
[0242]
[0243] 6.2.1.1.2.7 Calculate AUC (Area Under Curve): The area under the receiver operating characteristic curve (ROC curve). The ROC curve is a curve drawn based on a series of different binary classification methods (cutoff values or decision thresholds) with the true positive rate (sensitivity) as the ordinate and the false positive rate (1-specificity) as the abscissa. The calculation formula is:
[0244]
[0245] 6.2.1.1.2.8 Calculate the Brier Score: It measures the gap between the model prediction results and the actual results in the classification problem. The value range is between 0 and 1. The smaller the value, the higher the prediction accuracy of the model.
[0246]
[0247] Among them, M" = 104 represents the sample size in pv_test, f j is the predicted probability of the response prediction model for patient j in pv_test, o j is the actual class label of patient j in pv_test, usually 0 or 1.
[0248] 6.2.1.2 Use the indicator calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_RF model:
[0249] 6.2.1.3 Use the index calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_EBM model:
[0250] 6.2.1.4 Use the indicator calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_SVM model:
[0251] 6.2.1.5 Use the indicator calculation method described in step 6.2.1.1 to calculate the 8 evaluation indicators of the pv_LightGBM model:
[0252] 6.2.2 The eight evaluation indicators of the five response prediction models calculated based on the first test set are shown in Table 7. According to Table 7, it can be concluded that the best response prediction model based on the first training set among the five models obtained in 5.1 is pv_SVM.
[0253] Table 7: 8 evaluation indicators of 5 response prediction models calculated based on pv_test
[0254]
[0255] 6.3 Based on the second test set ml_test, the five response prediction models based on the second training set obtained in step 5.2 are evaluated using the response prediction model evaluation method described in step 6.2. The eight evaluation indicators of the five response prediction models calculated based on the first test set are shown in Table 8. According to Table 8, it can be concluded that the best response prediction model based on the second training set is ml_SVM.
[0256] Table 8: 8 evaluation indicators of 5 response prediction models calculated based on ml_test
[0257]
[0258] 6.4 Based on the first training set pv_test, three visualization curves (ROC curve, calibration curve, clinical decision curve) of the first best model are drawn as follows Figure 3 (a)- Figure 3 As shown in (c), three visualization curves of the second best model are drawn based on the second training set ml_test, as shown in Figure 3 (d)- Figure 3 (f) as shown. Figure 3 (a) and Figure 3 (b) are all ROC curves. The horizontal axis is the false positive rate, and the vertical axis is the true positive rate. The closer the ROC curve is to the upper left corner, the higher the accuracy of the model. The AUC value represents the area under the ROC curve. The closer it is to 1, the better the performance of the model. Figure 3 (a) and Figure 3 As can be seen in (b), the ROC curves of the two best models performed similarly, with AUC values of 0.74, indicating that the models have certain clinical application value. Figure 3 (c) and Figure 3 (d) are all calibration curves. The horizontal axis is the probability of the model predicting a response, and the vertical axis is the probability of the actual response. The gray dashed line represents a perfect calibration curve. The closer it is to the perfect calibration curve, the better the consistency and stability of the model. Figure 3 (c) and Figure 3 As can be seen in (d), the calibration curve of the second best model ml_SVM is closer to the perfect calibration curve and has better consistency. Figure 3 (e) and Figure 3 (f) are all clinical decision curves (DCA), the horizontal axis is the risk threshold, the vertical axis is the net benefit, the gray straight line represents the net benefit at each risk threshold when all subjects are intervened, and the gray dotted line represents the net benefit line when all subjects are not intervened. Since no intervention is performed, the net benefit is 0. If the net benefit of the DCA curve is higher than that of the gray straight line and the gray curve within a large horizontal axis range, it means that the DCA curve has a certain value. Figure 3 (e) and Figure 3 It can be seen from (f) that the DCA curve of the second best model ml_SVM obtains a higher net benefit in a wider range. Therefore, the final response prediction model selected is ml_SVM. ml_SVM and the corresponding training set ml_train (the training set contains t=t2=8 features) are sent to the model interpretation submodule.
[0259] In the seventh step, the model interpretation submodule uses the SHAP interpreter to perform global and local interpretations on the final response prediction model to obtain the final prediction model and an interpretable prediction system for the response of patients with septic shock to methylene blue treatment.
[0260] 7.1 The model interpretation submodule is a SHAP interpreter implemented by a "model interpretation package" shap developed in Python. When using it, you need to install the shap package first and import the SHAP library through the import shap statement.
[0261] 7.2 Use the "shap.Explainer" class to initialize the SHAP interpreter, input the training set ml_train used by the final response prediction model and the final response prediction model ml_SVM into the SHAP interpreter, complete the initialization of the SHAP interpreter, and obtain the initialized SHAP interpreter.
[0262] 7.3 The SHAP values of the 8 features in ml_train are calculated by the “shap_values” function in the SHAP interpreter, and the average values of the absolute values of the SHAP values of the 8 features in the training set used by the final response prediction model are calculated, avg_shap_1,…,avg_shap_f,…,avg_shap_8, where f is a positive integer and 1≤f≤8. The results are shown in Table 9.
[0263] Table 9: Importance values of each feature obtained by SHAP analysis based on ml_train
[0264]
[0265] 7.4 Perform a global interpretation of the final response prediction model ml_SVM, and use avg_shap_1, ..., avg_shap_f, ..., avg_shap_8 as the importance of the eight features for predicting the response to methylene blue. Use the "summary_plot" visualization function in the SHAP interpreter to get a ranking chart of the importance of the eight features to the model prediction, as shown in the figure below: Figure 6 shown. Figure 6 Each bar in the figure represents a feature, and its length indicates the average impact of the feature on the model output. A longer bar means that the feature has a greater impact on the model output, while a shorter bar means a smaller impact. By analyzing the distribution of feature importance, the threshold in this embodiment is half of the average SHAP value, that is, threshold = 0.023. Based on this threshold, the two most critical features for predicting the response to methylene blue were determined: the average nor-NEE in the first 6 hours before the start of methylene blue. pre and lactate levels.
[0266] 7.5 Perform a local interpretation of the final response prediction model, that is, explain how the eight features affect the prediction model's prediction results for a single patient. Use the "waterfall" visualization function in the SHAP interpreter to visualize the SHAP values of the eight features of any patient (let it be X1) calculated in step 7.3, and generate a waterfall chart of X1, such as Figure 4 As shown ( Figure 4In the figure, the influence of each feature on the model output is presented in the form of a bar graph. The red bar indicates that the feature has a positive effect on the prediction, and the blue bar indicates that the feature has a negative effect on the prediction. The height of the bar graph of each feature indicates the magnitude of the influence of the feature on the model output). In the waterfall chart of X1, the ordinate is feature 1 to feature 8 and the corresponding feature values (for example, feature 8 = 0.402 indicates that the value of feature 8 is 0.402), and the abscissa indicates the magnitude of the influence of each feature on the model output (for example, the influence of feature 8 on the model output is 0.8 (red color) indicating that the influence of feature 8 on the model prediction is 0.8 (positive effect)); E[f(X1)] = 0.17, indicating the initial prediction deviation of the model (the average result predicted by the model in the absence of any feature information), and f(X1) = 1 indicates the predicted output value of the model for a given sample X1, that is, predicting that X1 responds to the methylene blue drug.
[0267] 7.6 The final response prediction model ml_SVM and the initialized SHAP interpreter together constitute the final prediction model in the response prediction module. At this time, the best and interpretable methylene blue treatment response prediction system for patients with septic shock is obtained.
[0268] In the eighth step, the final interpretable prediction system for the response of septic shock patients to methylene blue treatment predicts the patient data X input by the user to obtain the prediction result, and the method is:
[0269] 8.1 The data preprocessing module receives the patient data X input by the user, as shown in Table 10, and preprocesses it by:
[0270] Table 10: User input patient data X
[0271]
[0272] 8.1.1 Perform data cleaning on X. Check whether there are missing values or outliers in the features of X, and use the average value of the feature in the training set of the final response prediction model to fill in the missing values or outliers. In this embodiment, there are no missing values or outliers, and the cleaned data X' is obtained.
[0273] 8.1.2 Perform data transformation on X'. For continuous features in X (including oxygenation index, lactate, age, weight, T NE 、T shock 、NEE pre ), based on the mean and variance of the corresponding features in ml_train, the Z-Score standardization method is used to standardize the features to obtain the standardized data X”; the classification feature oxygen therapy method in X” is uniquely encoded to obtain the pre-processed septic shock patient data X”’, and X”’ is sent to the prediction model in the response prediction module.
[0274] 8.2 The final response prediction model ml_SVM in the prediction model of the response prediction module predicts X'' and obtains a prediction result 1 (indicating a response) of whether the patient responds to the methylene blue drug.
[0275] 8.3 The SHAP interpreter in the prediction model of the response prediction module calculates the SHAP value of each feature in X'' for the prediction of the drug response to methylene blue, and uses the "waterfall" visualization function described in step 7.5 to visualize the SHAP value to generate a waterfall chart of X, such as Figure 5 In the waterfall chart of X, E[f(X)] = 0.15, indicating the initial prediction bias of the model, f(X) = 1 indicating the model's predicted output value for X (with response), the ordinate indicates the features and their corresponding feature values, the abscissa indicates the impact of each feature on the model output, and the color of the bar chart indicates the direction of the feature's impact on the model prediction (positive or negative). Specifically, feature NEE pre =3.75 has a positive impact on the model prediction, with an effect size of 0.73, characteristic weight = 80, lactate = 1.8, T NE =0.233, T shock =0.78 has a positive impact on the model prediction, with effect sizes of 0.05, 0.03, 0.02, and 0.01 respectively. The feature age = 66 and oxygenation index = 136 have a positive impact on the model prediction, with effect sizes <0.01, and the feature oxygen therapy mode = 1 has a negative impact on the model prediction, with an effect size <0.01. The waterfall chart of X shows the contribution of the features to the predicted results of the patient's response, helping doctors understand and trust the model to assist doctors in making decisions about X.
[0276] In this experimental environment, this embodiment proves that the following technical effects can be achieved by adopting the present invention:
[0277] 1. In the above embodiment, the present invention has achieved a good prediction effect through verification of the test set of hospital data. Specifically, the overall accuracy of predicting the patient's response to methylene blue reached 76%, and the accuracy of predicting the patient's non-response to methylene blue reached 94%. Therefore, this embodiment proves that the present invention can accurately identify patients who are non-responsive to methylene blue, reduce the risk caused by the incorrect use of the drug, and avoid the problem that whether methylene blue is used for pressor treatment in patients with septic shock mainly depends on the doctor's experience.
[0278] 2. The clinical decision curve analysis in this embodiment shows that the present invention has a higher net benefit within a larger risk threshold interval, which is better than the strategy of treating all patients or not treating any patients, which shows that no matter under a lower or higher risk threshold setting, the prediction model of the present invention can obtain a significant net benefit, and therefore, this embodiment proves the clinical application value of the present invention. The calibration curve analysis of this embodiment shows that there is good consistency between the probability predicted by the model in the present invention and the actual probability of occurrence, which shows that the prediction model of the present invention is not only accurate as a whole, but also has good reliability and consistency in individual risk prediction.
[0279] 3. In the hospital of this example, the SHAP interpreter obtains NEE pre and lactic acid are key factors affecting the drug response of methylene blue. The model prediction process is explained in conjunction with the SHAP interpreter, which enhances the transparency and interpretability of the model, thereby improving the doctor's trust in the prediction model. This example demonstrates the clinical applicability of the present invention.
[0280] Therefore, the present invention achieves the effect of improving the identification of methylene blue drug response in septic shock patients by using an interpretable model.
[0281] The above is a detailed introduction to a method for predicting the response of methylene blue treatment in patients with septic shock based on an interpretable model provided by the present invention. This article explains the principles and implementation methods of the present invention, and the above description is used to help understand the core idea of the present invention. It should be pointed out that for ordinary researchers in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model; characterized in that The following steps are involved: The first step is to build a prediction system for the response of patients with septic shock to methylene blue therapy. The prediction system for the response of patients with septic shock to methylene blue therapy consists of a data preprocessing module, a feature engineering module, and a response prediction module. The data preprocessing module is connected to the feature engineering module. During training, the data preprocessing module reads the original data set S1, performs data cleaning on the features in S1, and obtains the cleaned data set S2; then performs data transformation on S2 to obtain the preprocessed data set S3, and sends S3 to the feature engineering module; when predicting the septic shock patient data X input by the user, data cleaning is performed on X to obtain the cleaned data X', and then data transformation is performed on X' to obtain the preprocessed septic shock patient data X"', and X"' is sent to the response prediction module; The feature engineering module is connected to the data preprocessing module and the response prediction module; during training, the feature engineering module receives the data set S3 input by the data preprocessing module, first uses a statistical method to screen significant features, obtains a first data set pv_data, and divides pv_data into a first training set pv_train and a first test set pv_test; then uses a machine learning method to screen features on S3 to obtain a second data set ml_data, and divides ml_data into a second training set ml_train and a second test set ml_test; sends the first training set pv_train, the first test set pv_test, the second training set ml_train, and the second test set ml_test to the response prediction module; The response prediction module is connected to the feature engineering module and the data preprocessing module. The response prediction module consists of a model training submodule, a model screening submodule, a model interpretation submodule, and a prediction model. The model training submodule is connected to the feature engineering module and the model screening submodule, and includes a logistic regression model LR, a random forest model RF, a support vector machine model SVM, an interpretable boosting machine model EBM, and a lightweight gradient boosting machine model LightGBM. During training, the model training submodule receives the first training set pv_train input by the feature engineering module, trains 5 models, and adjusts the hyperparameters of the 5 models to obtain 5 response prediction models. The model training submodule also receives the second training set ml_train input by the feature engineering module, trains 5 models, and adjusts the hyperparameters of the 5 models to obtain 5 response prediction models. After training, a total of 10 response prediction models are obtained, and the 10 response prediction models are sent to the model screening submodule. The model screening submodule is connected to the feature engineering module, the model training submodule, and the model interpretation submodule. During training, the model screening submodule receives 10 response prediction models input by the model training submodule, and when receiving the first test set pv_test input by the feature engineering module, it evaluates the 5 response prediction models established based on the first training set pv_train; when receiving the second test set ml_test input by the feature engineering module, it evaluates the 5 response prediction models established based on the second training set ml_train, and evaluates the 10 response prediction models received from the model training submodule to obtain the best response prediction model; the best response prediction model and the data set used by it are sent to the model interpretation submodule; The model interpretation submodule is connected to the model screening submodule. During training, the model interpretation submodule receives the best response prediction model and the data set used by the model screening submodule, inputs them into the SHAP interpreter, and uses the SHAP interpreter to perform global and local interpretations on the best response prediction model, obtain the importance of each feature to the prediction of methylene blue drug response and how each feature affects the prediction model's prediction of a single patient; The best response prediction model and the SHAP interpreter together constitute the final prediction model obtained through training; when predicting the single septic shock patient data X input by the user, the prediction model receives X'' input by the data preprocessing module, the best response prediction model in the prediction model outputs the prediction result of the patient's response to the methylene blue drug, and the SHAP interpreter in the prediction model outputs the SHAP value of each feature for the patient's response prediction result, and visualizes these SHAP values to show the contribution of each feature to the patient's response prediction result; The second step is to construct the original dataset S1 by: 2.1 Initialize the original data set S1 to be empty. Each table entry of S1 includes 26 fields, namely the patient ID number, 24 features for building the model, and the label of whether the patient responds to the methylene blue drug; 2.2 Extract the patient ID number from the hospital's sepsis database and include it in S1; let the patient ID numbers in S1 be M at this time, where M is a positive integer, that is, S1 has M entries at this time, and 1 entry corresponds to 1 patient's sample; 2.3 According to the patient ID number in S1, 24 features for model construction were extracted from the hospital's sepsis database, including patient gender, age at hospitalization, weight, smoking history, drinking history, comorbidities, ICU type, whether terlipressin was used, whether hormones were used, and the average nor-NEE 6 hours before starting methylene blue. pre , oxygen therapy method, oxygenation index OI, whether continuous renal replacement therapy CRRT, lactate, central venous oxygen saturation ScvO2, time T from the start of methylene blue to the first start of norepinephrine NE , Time T from initiation of methylene blue to diagnosis of shock shock , put these contents into the table corresponding to the patient id number of S1; the above 24 features are divided into continuous features and categorical features; continuous features include the patient's age, weight, NEE pre , OI, lactate, ScvO2, T NE 、T shock , the classification characteristics include patient gender, smoking history, drinking history, hypertension, diabetes, coronary heart disease, atrial fibrillation, lung disease, kidney disease, liver disease, immune suppression, ICU type, whether terlipressin is used, whether hormones are used, oxygen therapy method, and whether continuous renal replacement therapy is used; 2.4 Based on the following conditions, the labels of whether the M patients in S1 respond to methylene blue are obtained. If there is a response, the label is 1, and if there is no response, the label is 0: The patient responds to methylene blue, that is, the effective pressor is defined as meeting one of the following two conditions: (1) NEE decreases>10% and the mean arterial pressure MAP_avg_post≥65mmHg; (2) NEE decreases, remains unchanged, or increases<10%, that is, 10%>NEE%≥-10% but the mean arterial pressure change value MAP_avg% increases≥10mmHg; When one of the above two conditions is met, methylene blue pressor is considered to be effective, and the label corresponding to the patient id number in S1 is assigned to 1. When both conditions are not met, methylene blue pressor is defined as ineffective, and the label corresponding to the patient id number in S1 is assigned to 0; Among them, the change value of NEE NEE%=(NEE post -NEE pre ) / NEE pre ×100%,NEE post is the average nor-methylene blue equivalent 6 hours after the start of methylene blue; mean arterial pressure MAP = [systolic pressure + (diastolic pressure × 2)] / 3, the normal value of mean arterial pressure for normal adults is 70-105 mmHg; the average value of mean arterial pressure MAP_avg within 6 hours before and after the start of methylene blue is calculated to obtain MAP_avg_pre and MAP_avg_post, and the change value of MAP_avg MAP_avg% = (MAP_avg_post-MAP_avg_pre); at this time, the patient who responds in S1 is M_1, and the patient who does not respond is M_0; In the third step, the data preprocessing module preprocesses the data set S1 to obtain the preprocessed data set S3; 3.1 Clean up the data of S1 by: 3.1.1 Use boxplot to detect outliers in S1, delete outliers or fill them with the average value of the feature, and obtain data set S1'. There are M2 patient ID numbers in S1', M2≤M and M2 is a positive integer. The outliers refer to wrongly recorded data values or abnormal data values; 3.1.2 Delete the features with missing data ratio exceeding 30% in S1'. For the features with missing data ratio <30%, use the multiple KNN interpolation method for interpolation. The missing data ratio refers to the ratio of the number of missing data in a certain feature data to the total number of data M2. The specific steps are: 3.1.2.1 Split S1' into the part with missing values S11 and the complete part S12. S11 is the feature that needs to be interpolated. 3.1.2.2 Interpolate S11 to obtain K interpolated data sets S111, ..., S11 k , …, S11 K , 1≤k≤K and k is a positive integer, K is a positive integer, S111,…,S11 k , …, S11 K The patient ID numbers in the table are all M2. The difference from S11 is that the features with missing data ratio <30% have been fully imputed, and there are no features with missing data ratio ≥30%. Based on S111, ..., S11 k , …, S11 K Randomly divide the training set and test set and perform model training and evaluation to obtain avg_accuracy1, ..., avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K ,avg_accuracy k For S11 k The average accuracy, avg_rmse k For S11 k The average root mean square error of 3.1.2.3 Comparison of avg_accuracy k , …, avg_accuracy k , …, avg_accuracy K and avg_rmse1,…,avg_rmse k , …, avg_rmse K , select the data set S11 corresponding to the k value with the largest average accuracy and relatively small average root mean square error k As the cleaned data set S2; there are T features in S2, including T1 continuous features and T2 categorical features, T1+T2=T, T≤24 and T is a positive integer; 3.2 Transform the data of S2 by: 3.2.1 The T1 continuous feature data of M2 patients in S2 are standardized using the Z-Score standardization method to obtain the standardized data set S2'. The method is: 3.2.1.1 S2 is divided into a part S21 containing T1 continuous feature data and a part S22 containing T2 categorical feature data; 3.2.1.2 Standardize the features in S21 to obtain a standardized data set S21; 3.2.1.3 Merge S21' and S22 to obtain the standardized feature dataset S2'; 3.2.2 Perform one-hot encoding on the T2 categorical feature data of M2 patients in S2' to obtain the preprocessed data set S3, which also contains M2 one-hot encoded patient samples; send S3 to the feature engineering module; In the fourth step, the feature engineering module uses statistical methods and machine learning methods to perform feature engineering on the preprocessed data set S3, and constructs two training sets and two test sets for the training model; 4.1 The feature engineering module uses statistical methods to perform feature engineering on S3 to obtain the first data set pv_data, which contains t1 features. pv_data is divided into a first training set pv_train and a first test set pv_test. pv_train is sent to the model training submodule in the response prediction module, and pv_test is sent to the model screening submodule in the response prediction module. pv_train contains M' patients, and pv_test contains M" patients, M'+M"=M2; 4.2 The feature engineering module uses machine learning methods to perform feature engineering on S3 to obtain a data set ml_data for final modeling. ml_data contains t2 features. ml_data is divided into a second training set ml_train and a second test set ml_test. ml_train is sent to the model training submodule in the response prediction module, and ml_test is sent to the model screening submodule in the response prediction module. ml_train contains MM' patients, and ml_test contains MM" patients. MM'+MM"=M2; Step 5: The model training submodule in the response prediction module uses the first training set pv_train and the second training set ml_train to train five machine learning models respectively to obtain 10 response prediction models. 5.1 Using the model training method, the first training set pv_train was used to train the LR model, RF model, EBM model, SVM model and LightGBM model; the grid search and 5-fold cross-validation methods were used to adjust the hyperparameter combination of the model, and 5 response prediction models based on the first training set were obtained. The specific method is: 5.1.1 The first training set pv_train is used to train the LR model. The grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_LR. 5.1.2 The first training set pv_train is used to train the RF model. The grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_RF. 5.1.3 The first training set pv_train is used to train the EBM model, and the grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_EBM; 5.1.4 The first training set pv_train is used to train the SVM model, and the grid search and 5-fold cross-validation methods are used to adjust the model's hyperparameter combination. The accuracy of the model is used as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_SVM; 5.1.5 Use the first training set pv_train to train the LightGBM model, use grid search and 5-fold cross-validation methods to adjust the model's hyperparameter combination, and use the model's accuracy as the evaluation criterion to select the best hyperparameter combination to obtain the response prediction model pv_LightGBM; 5.2 Using the model training method described in 5.1, the LR model, RF model, EBM model, SVM model and LightGBM model are trained using the second training set ml_train to obtain five response prediction models based on the second training set, namely ml_LR, ml_RF, ml_EBM, ml_SVM and ml_LightGBM; 5.3 Sending 5 response prediction models established based on the first training set and 5 response prediction models established based on the second training set to the model screening submodule; Step 6: The model screening submodule uses the first test set pv_test and the second test set ml_test to evaluate the 10 response prediction models and select the best model as the final response prediction model. 6.1 Initialize the confusion matrix A to be empty. The confusion matrix A contains 4 elements, namely a 11 , a 12 , a 21 , a 22 , are initially 0; a 11 Stores the number of true positives TP, where the model predicts that the label is 1 and the true label is also 1. 12 Stores the number of false positives (FP) where the model predicts the label to be 1 and the true label to be 0. 21 Stores the number of false negatives FN where the model predicts the label to be 0 and the true label to be 1, a 22 Stores the number of true negatives TN where the model predicts the label to be 0 and the actual label is 0; 6.2 Based on the first test set pv_test, the five response prediction models based on the first training set obtained in 5.1 are evaluated using the response prediction model evaluation method to obtain an optimal response prediction model based on the first training set. The method is: 6.2.1 Based on the first test set pv_test, the eight evaluation indicators of the five response prediction models, including accuracy ACC, sensitivity, specificity, F1 Score, positive predictive value PPV, negative predictive value NPV, AUC value, and Brier score, were calculated respectively; 6.2.1.1 Calculate the eight evaluation indicators of the pv_LR model using the indicator calculation method: 6.2.1.1.1 Input the M” patients in the first test set into the pv_LR model established in 5.1.
1. The pv_LR prediction model outputs the results of the M” patients’ response to the methylene blue drug, i.e., 1 for response and 0 for no response, as well as the probability value of the M” patients’ response to the methylene blue drug. By counting the actual labels and the predicted labels, the confusion matrix A is filled to obtain the filled confusion matrix A, i.e., a 11 =TP,a 12 =FP,a 21 =FN,a 22 =TN, where TP represents the number of patients who are correctly predicted as responding to methylene blue by the pv_LR model among M” patients who actually respond; FP represents the number of patients who are incorrectly predicted as responding to methylene blue by the pv_LR model among M” patients who actually do not respond to methylene blue; FN represents the number of patients who are incorrectly predicted as non-responsive to methylene blue by the pv_LR model among M” patients who actually respond to methylene blue; TN represents the number of patients who are correctly predicted as non-responsive to methylene blue by the pv_LR model among M” patients who actually do not respond to methylene blue, TP+TN+FP+FN=M”; 6.2.1.1.2 Based on the filled confusion matrix A, calculate 8 evaluation indicators: 6.2.1.1.2.1 Calculate the accuracy ACC: the ratio of the number of samples correctly predicted by the classification model to the total number of samples: 6.2.1.1.2.2 Calculate sensitivity: The ratio of the number of samples correctly predicted as positive by the classification model to the number of all positive samples: 6.2.1.1.2.3 Calculate specificity: The ratio of the number of samples correctly predicted as counterexamples by the classification model to the number of all counterexample samples: 6.2.1.1.2.4 Calculate F1-score: The harmonic mean of precision and recall: 6.2.1.1.2.5 Calculate the positive predictive value (PPV): the proportion of samples predicted by the classification model to be positive that are actually positive: 6.2.1.1.2.6 Calculate the negative predictive value NPV: the proportion of samples predicted by the classification model to be negative examples that are actually negative examples: 6.2.1.1.2.7 Calculation of AUC: The area under the receiver operating characteristic curve (ROC) is calculated using the following formula: 6.2.1.1.2.8 Calculate Brier Score: It measures the gap between the model prediction result and the actual result in the classification problem. The value range is between 0 and 1. The smaller the value, the higher the prediction accuracy of the model. Among them, M" represents the sample size in pv_test, f j is the predicted probability of the response prediction model for patient j in pv_test, o j is the actual category label of patient j in pv_test, usually 0 or 1; 6.2.1.2 Use the indicator calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_RF model: 6.2.1.3 Use the index calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_EBM model: 6.2.1.4 Use the indicator calculation method described in step 6.2.1.1 to calculate the eight evaluation indicators of the pv_SVM model: 6.2.1.5 Use the indicator calculation method described in step 6.2.1.1 to calculate the 8 evaluation indicators of the pv_LightGBM model: 6.2.2 The larger the accuracy, sensitivity, specificity, F1Score, positive predictive value PPV, negative predictive value NPV, and AUC values, the better. The smaller the Brier score, the better. The performance of the five models is evaluated based on these eight evaluation indicators. Among the five models, if the number of these indicators that reach the optimal value is the same, the model with better Accuracy and AUC values is preferred, and the best response prediction model based on the first training set among the five models obtained in 5.1 is obtained, referred to as the first best model. 6.3 Based on the second test set ml_test, use the response prediction model evaluation method described in step 6.2 to evaluate the 5 response prediction models obtained in 5.2 based on the second training set, and obtain an optimal response prediction model based on the second training set, abbreviated as the second optimal model; 6.4 Plot 3 visualization curves of the first optimal model, namely the ROC curve, calibration curve, and clinical decision curve DCA, based on the first training set pv_test, and plot 3 visualization curves of the second optimal model based on the second training set ml_test; Compare the performance of the first optimal model and the second optimal model in the 3 visualization curves, and select the model with better performance and more in the visualization curves as the final response prediction model; Send the final response prediction model and the training set it uses to the model interpretation sub-module. The training set contains t features, where t = t1 or t2; Seventh step, the model interpretation sub-module uses the SHAP explainer to perform global and local interpretations on the final response prediction model, and obtains the final prediction model and an interpretable methylene blue treatment response prediction system for septic shock patients; 7.1 The model interpretation sub-module is a SHAP explainer implemented by a "model interpretation package" shap developed in Python. When using it, the shap package needs to be installed first, and the SHAP library is imported through the import shap statement; 7.2 Initialize the SHAP explainer using the "shap.Explainer" class, and input the training set used by the final response prediction model and the final response prediction model into the SHAP explainer to complete the initialization of the SHAP explainer and obtain the initialized SHAP explainer; 7.3 Calculate the SHAP values of the t features in the training set used by the final response prediction model through the "shap_values" function in the SHAP explainer, and calculate the average values avg_shap_1,..., avg_shap_f,..., avg_shap_t of the absolute values of the SHAP values of the t features in the training set used by the final response prediction model, where f is a positive integer and 1 ≤ f ≤ t; 7.4 Perform global interpretation on the final response prediction model, using avg_shap_1,..., avg_shap_f,..., avg_shap_t as the importance degrees of the t features for methylene blue drug response prediction; Obtain a ranking plot of the importance of the t features for model prediction through the "summary_plot" visualization function in the SHAP explainer; Find the features in avg_shap_1,..., avg_shap_f,..., avg_shap_t that are less than the threshold threshold, and let the number of features in avg_shap_1,..., avg_shap_f,..., avg_shap_t that are less than threshold be t3. Then these t3 features are the key features for methylene blue drug response, where t3 < t and t3 is a positive integer; 7.5 Perform a local interpretation of the final response prediction model, that is, explain how the t features affect the prediction model's prediction results for a single patient; use the "waterfall" visualization function in the SHAP interpreter to visualize the SHAP values of the t features of any patient X1 calculated in step 7.3, and generate a waterfall chart of X1. In the waterfall chart of X1, E[f(X1)] represents the initial prediction deviation of the model, and f(X1) represents the predicted output value of the model for a given sample X1. The impact of each feature on the model output is presented in the form of a bar chart. Red bars indicate that the feature has a positive effect on the prediction, and blue bars indicate that the feature has a negative effect on the prediction. The height of each feature's bar chart indicates the magnitude of the impact of the feature on the model output. The waterfall chart of X1 shows the contribution of each feature to the response prediction results of patient X1. 7.6 The final response prediction model and the initialized SHAP interpreter together constitute the final prediction model in the response prediction module. At this time, the best interpretable prediction system for the response of septic shock patients to methylene blue treatment is obtained; In the eighth step, the final interpretable prediction system for the response of septic shock patients to methylene blue treatment predicts the patient data X input by the user to obtain the prediction result, and the method is: 8.1 The data preprocessing module preprocesses the patient data X input by the user by: 8.1.1 Clean the data of X; check whether there are missing values or outliers in the features of X. If there are, fill them with the average value of the feature in the training set of the final response prediction model to obtain the cleaned data X'; 8.1.2 Perform data transformation on X'; for continuous features in X, based on the mean and variance of the corresponding features in the training set of the final response prediction model, use the Z-Score standardization method to standardize the features to obtain the standardized data X"; perform one-hot encoding on the categorical features in X" to obtain the preprocessed septic shock patient data X"', and send X"' to the prediction model in the response prediction module; 8.2 The final response prediction model in the prediction model of the response prediction module predicts X'' and obtains the prediction result of whether the patient responds to the methylene blue drug, that is, responds or does not respond; 8.3 The SHAP interpreter in the prediction model of the response prediction module calculates the SHAP value of each feature in X'' for the prediction of the methylene blue drug response, and uses the "waterfall" visualization function described in step 7.5 to visualize the SHAP value to generate a waterfall chart of X. In the waterfall chart of X, E[f(X)] represents the initial prediction deviation of the model, f(X) represents the predicted output value of the model for X, and the impact of each feature on the model output is presented in the form of a bar chart. Red bars indicate that the feature has a positive effect on the prediction, and blue bars indicate that the feature has a negative effect on the prediction; the waterfall chart of X shows the contribution of each feature to the prediction result of the patient X response.
2. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 1, characterized in that The method for extracting patient ID numbers from the hospital's sepsis database as described in step 2.2 is to extract patient ID numbers that meet the following three conditions: (1) diagnosed with septic shock; (2) patient age ≥18 years old; (3) receiving methylene blue as a second-line vasoconstrictor drug for pressor therapy, and methylene blue was started at least 6 hours after the patient received norepinephrine infusion; if the patient used methylene blue to pressor multiple times, the patient with a time interval of more than 6 hours from the second use of methylene blue was included in S1; and the patient ID numbers that met one of the following conditions were deleted from S1: (1) the ICU stay after the use of methylene blue was less than 24 hours; (2) patients for whom it was unclear whether methylene blue was used for pressor therapy and whose effectiveness could not be judged due to missing data.
3. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 1, characterized in that The comorbidities in step 2.3 include hypertension, diabetes, coronary heart disease, atrial fibrillation, lung disease, kidney disease, liver disease, and immune suppression; the ICU types include central ICU and other ICUs; the oxygen therapy methods include invasive ventilator-assisted breathing and non-invasive assisted breathing; the average nor-NEE equivalent in the 6 hours before starting methylene blue pre The formula for calculating NEE is: NEE = Norepinephrine dose (μg / kg / min) + 1 / 100 × dopamine dose (μg / kg / min) + 0.06 × phenylephrine dose (μg / kg / min) + 10 × terlipressin dose (μg / kg / min) + 0.2 × methylene blue dose (mg / kg / h) + 8 × metaraminol dose (μg / kg / min) + 0.02 × hydroxocobalamin vitamin B12 dose(g)+0.4×midodrine dose(μg / kg / min); oxygenation index OI=PaO2 / FiO2, where PaO2 is the partial pressure of oxygen in arterial blood, FiO2 is the percentage of inspired oxygen concentration, and the normal value of OI is 400-500mmHg; lactic acid is mainly used to detect the lactate content in the blood, and the normal value is 0.5~1.7mmol / L; central venous oxygen saturation ScvO2 refers to the oxygen saturation level in the central venous blood of the human body, and is one of the important indicators for evaluating the oxygen supply and demand balance of patients. The normal value of ScvO2 is between 70% and 75%.
4. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 1, characterized in that As described in step 3.1.2.2, interpolation processing is performed on S11 to obtain S111, ..., S11 k , …, S11 K , and based on S111,…,S11 k , …, S11 K Randomly divide the training set and test set and perform model training and evaluation to obtain avg_accuracy1, ..., avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K The method is 3.1.2.2.1 Let k = 1: 3.1.2.2.2 Perform the k-th KNN interpolation on the missing values of each feature in S11: 3.1.2.2.2.1 Calculate the distance between the samples with missing feature values in S11 and each sample in S12; 3.1.2.2.2.2 Select the k samples with the closest distance; 3.1.2.2.2.3 For continuous features in S11, the missing values are filled by calculating the average value of k samples by weighted average; for categorical features in S11, the missing values are filled by voting to select the most frequent category in the categorical features, and the interpolated S11' is obtained; 3.1.2.2.2.4 Combine the interpolated S11' and S12 to obtain the k-th interpolated dataset S11 k ; 3.1.2.2.3 For S11 k Perform N evaluations to obtain N pairs of S11 k The evaluation indicators are accuracy-1, ..., accuracy-n, ..., accuracy-N and N root mean square errors rmse-1, ..., rmse-n, ..., rmse-N, where n ranges from 1 to N and n is a positive integer; accuracy-n is the nth time for S11 k The evaluation index accuracy, rmse-n is the nth time for S11 k The evaluation indicator root mean square error, N is a positive integer, the method is: 3.1.2.2.3.1Let n = 1; 3.1.2.2.3.2 For S11 k Randomly divide the data into training set n_train and test set n_test in a ratio of 3:
1. 3.1.2.2.3.3 Train the random forest model based on n_train, evaluate the established random forest model based on n_test, and calculate the accuracy accuracy-n and the root mean square error rmse-n of the random forest model after the nth training; 3.1.2.2.3.4 Let n = n + 1. If n ≤ N, go to 3.1.2.2.3.2 and continue to randomly divide the training set and test set for model training and evaluation. Otherwise, after obtaining accuracy-1, …, accuracy-n, …, accuracy-N and rmse-1, …, rmse-n, …, rmse-N, go to 3.1.2.2.
4. 3.1.2.2.4 Calculate the average of accuracy-1, ..., accuracy-n, ..., accuracy-N and get S11 k The average accuracy avg_accuracy k , calculate the average of rmse-1, ..., rmse-n, ..., rmse-N, and get S11 k The average root mean square error avg_rmse k ; 3.1.2.2.5 Let k = k + 1. If k ≤ K, go to 3.1.2.2.
1. Otherwise, get avg_accuracy1, ..., avg_accuracy k , …, avg_accuracy K , and avg_rmse1,…, avg_rmse k , …, avg_rmse K .
5. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 4, characterized in that The K is 20 and the N is 20.
6. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 1, characterized in that The method for standardizing the features in S21 in step 3.2.1.2 to obtain the standardized data set S21' is: 3.2.1.2.1Let variable i = 1; 3.2.1.2.2 Calculate the mean μ of the i-th continuous feature in S21 i and standard deviation σ i ; 3.2.1.2.3 Perform data standardization on the i-th continuous feature of M2 patients in S21 to obtain the value of M2 standardized i-th continuous feature, the method is: 3.2.1.2.3.1Let variable j = 1; 3.2.1.2.3.2 The characteristic value x of the jth patient for the i-th continuous characteristic j Standardize and get x j ′, The calculation formula is: in, x j is the original eigenvalue of the jth patient, x j ′ is the standardized eigenvalue; 3.2.1.2.3.3 Using the standardized eigenvalue x j ′Replace the original eigenvalue x j ; 3.2.1.2.3.4 Let j = j + 1. If j ≤ M2, go to 3.2.1.2.3.
2. Otherwise, go to 3.2.1.2.
4. 3.2.1.2.
4. Let i=i+1. If i≤T1, go to 3.2.1.2.
2. Otherwise, obtain the standardized feature data set S21'.
7. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 1, characterized in that The method by which the feature engineering module in step 4.1 uses statistical methods to perform feature engineering on S3 is: 4.1.1 S3 was divided into two groups according to the label of whether the patients responded to methylene blue, namely the responding group and the non-responding group; 4.1.2 Based on the hypothesis test method, the intergroup difference analysis of each feature of the response group and the non-response group was performed; the chi-square test method was used to compare the differences in the categorical features between the response group and the non-response group, that is, the P value was calculated, and the P value was used to determine whether the differences in the categorical features between the response group and the non-response group were significant; for continuous features, the independent sample t-test method was used to compare the differences between the response group and the non-response group for continuous features that conformed to the normal distribution, that is, the P value was calculated; for continuous features that did not conform to the normal distribution, the Wilcoxon rank sum test method was used to compare the differences between the response group and the non-response group, that is, the P value was calculated; the features with a P value <0.3 were screened out; 4.1.3 Exploration through Pearson correlation coefficient test The correlation between the features screened in 4.1.2, after removing redundant features, the first data set pv_data is obtained, and pv_data contains t1 features; 4.1.4 Divide pv_data into the first training set pv_train and the first test set pv_test in a ratio of 3:
1.
8. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 1, characterized in that The method in which the feature engineering module in step 4.2 uses machine learning methods to perform feature engineering on S3 is: 4.2.1 Using random forest as the base model, recursive feature elimination and cross-validation methods are used to screen the features of S3. By gradually removing features and using cross-validation to determine the best feature subset, the data set ml_data for final modeling is obtained. ml_data contains t2 features. 4.2.2 Divide ml_data into the second training set ml_train and the second test set ml_test in a ratio of 3:
1.
9. A method for predicting the response of patients with septic shock to methylene blue treatment based on an interpretable model as claimed in claim 1, characterized in that The threshold value described in step 7.4 is selected according to the feature importance distribution, threshold = (avg_shap_1 + ... + avg_shap_f + ... + avg_shap_t) / (2×t)).
