A method and system for predicting patient secondary test items based on supervised learning

By using random forest classification and feature encoding, a predictive model for auxiliary examination items is constructed, which solves the problems of complex training, reliance on historical data, neglect of feature correlation and high computational complexity in existing technologies. It achieves efficient and accurate prediction of patient auxiliary examination items and improves the efficiency of medical resource utilization.

CN119943427BActive Publication Date: 2025-11-25HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510012182.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-11-25
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

Existing technologies for predicting patient auxiliary examination items suffer from problems such as complex training that relies on a large amount of historical data, neglecting the correlation between features, high computational complexity, sensitivity to outliers, high resource consumption, and lack of interpretability, resulting in poor prediction performance.

Method used

A random forest classification method is adopted, and an auxiliary examination item prediction model is constructed by feature encoding and ensemble of multiple decision trees. Electronic medical record data is used for preprocessing and feature extraction. Combined with Gini index splitting features, the model avoids reliance on a large amount of historical data and complex calculations, thereby improving the robustness and interpretability of the model.

Benefits of technology

It effectively solves the problems of insufficient prediction of early auxiliary examination items, neglect of feature correlation, high computational complexity and high resource consumption of existing methods, improves prediction accuracy and efficiency, reduces the model's sensitivity to outliers, and achieves more efficient use of medical resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119943427B_ABST
    Figure CN119943427B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on supervised learning prediction patient auxiliary examination item method, comprising the following steps: obtaining the electronic medical record of inpatient, it and corresponding hospitalization number are stored as the source data of inpatient in the form of Excel table, the source data of inpatient obtained is preprocessed, to obtain the preliminary prediction result of auxiliary examination item of inpatient after preprocessed source data, and the preliminary prediction result is decoded using the auxiliary examination coding table established in advance, to obtain the final prediction result of auxiliary examination item of inpatient.The application can solve the technical problems that the existing LSTM model cannot predict the auxiliary examination item of patient's early disease due to the complexity of training, relying on a large number of historical time series data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of supervised learning in machine learning, and more particularly relates to a method and system for predicting patient auxiliary examination items based on supervised learning. BACKGROUND

[0002] With the growth of population and the intensification of aging problems, the demand for medical treatment is rising, and the shortage of medical resources affects the efficiency and quality of medical services. In this context, how to reasonably plan medical resources and improve medical efficiency has become an important problem for medical institutions to solve. Predicting the auxiliary examination items that patients may need provides strong support for improving the efficiency of medical resource utilization and optimizing the medical service process. By accurately predicting the auxiliary examination needs of patients, the examination time and equipment can be arranged in advance, reducing the waiting time of patients and avoiding unnecessary repeated examinations, thereby effectively saving medical costs. In addition, accurate auxiliary examination prediction can help doctors better develop treatment plans and improve the timeliness and accuracy of diagnosis. Ultimately, this not only helps to improve the quality of medical services, but also promotes the progress of personalized medicine and intelligent medical decision-making, thereby promoting the efficient operation of the entire medical system.

[0003] Currently, there are few studies on predicting patient auxiliary examination items, and existing methods mainly focus on the fields of deep learning and machine learning. The first method is to realize it by training a long-short term memory (LSTM) model; this method mainly uses the historical medical record data of patients (such as past examination records, treatment history, etc.) as time series input to predict the auxiliary examination items that patients may need in the future; the second method is realized by a Naive Bayes classifier, which is based on Bayes' theorem and assumes that the various features of patients are independent of each other. It uses prior probability and conditional probability to calculate posterior probability for classification, calculates the probability of each examination item occurring, and selects the item with the maximum probability as the prediction result; the third method is through the K-nearest neighborhood (KNN) algorithm, which calculates the distance between the test patient and the historical patients in various features (such as age, symptoms, past medical history, etc.), selects the examination results of the K most similar historical patients, and performs voting or weighted averaging to predict the examination items required by the patient; the fourth method is a reinforcement learning (RL) method, which regards the treatment process of each patient as a "state", auxiliary examination as an "action", and the final treatment effect as a "reward". Through multiple training, the reinforcement learning model can learn which examination items are most likely to affect the diagnosis or treatment effect of patients, thereby making reasonable predictions.

[0004] However, the above-mentioned several existing methods of predicting patient auxiliary examination items all have some defects that cannot be ignored:

[0005] First, the LSTM model can effectively process time series data, but its training process is very complex and requires a large amount of labeled data. For long-term dependencies in medical data, the LSTM model may rely on a large amount of patient historical data, making it difficult to predict auxiliary examination items for early stages of patient diseases.

[0006] Second, the Bayesian classifier assumes that patient features are independent of each other, but in reality, various patient features often have high correlation (for example, the association between medical history and symptoms). This model does not handle the dependency between features well, which may lead to biased prediction results, especially when dealing with complex medical data, the performance of the Bayesian classifier is poor.

[0007] Third, the KNN method has high computational complexity, especially when the sample size is large, calculating the distance between each test sample and all training samples may result in long computation time. In addition, the KNN method is sensitive to noise and outliers, which may be affected by a small number of abnormal cases, resulting in poor robustness of the model. At the same time, this method depends on appropriate distance metrics, and if the dimensionality of the feature space is high, the performance of the KNN method will also decrease significantly.

[0008] Fourth, reinforcement learning faces many challenges when dealing with medical data: First, medical decisions often involve long-term chain reactions, and model training requires a large amount of interaction data and high demand for computing resources. Second, the reward function design of reinforcement learning is complex, and it is difficult to determine appropriate reward criteria in medical applications. Over-reliance on the reward mechanism may lead the model to favor certain decisions, while ignoring individual differences and the complexity of treatment. In addition, reinforcement learning has poor interpretability in practical applications, and it is not easy to understand how the model arrives at a particular prediction result, which affects its widespread application in medical scenarios. SUMMARY

[0009] In view of the above defects or improvement needs of the prior art, the present application provides a method and system for predicting patient auxiliary examination items by random forest classification, which aims to solve the technical problems that the existing LSTM model cannot predict the auxiliary examination items in the early stage of the patient's disease due to the complexity of training and the dependence on a large amount of historical time series data, and the technical problems that the existing Bayesian classifier has deviation in the prediction result due to the neglect of the correlation between features and the poor processing ability of complex data, and the technical problems that the existing KNN method has poor model robustness due to high algorithm complexity and sensitivity to outliers under large-scale data, and the technical problems that the existing reinforcement learning method has large resource consumption and lack of interpretability in the model training process due to the high requirements for data type and data set size and the complex reward mechanism design.

[0010] To achieve the above-mentioned purpose, according to one aspect of the present application, a method for predicting patient auxiliary examination items based on supervised learning is provided, comprising the following steps:

[0011] (1) Obtain the electronic medical record of the hospitalized patient, and store it and the corresponding hospitalization number in the form of an Excel table as the source data of the hospitalized patient.

[0012] (2) Preprocess the source data of the hospitalized patient obtained in step (1) to obtain the preprocessed source data.

[0013] (3) Input the preprocessed source data in step (2) into a pre-trained auxiliary examination item prediction model to obtain a preliminary prediction result of the auxiliary examination items of the hospitalized patient, and use a pre-established auxiliary examination coding table to decode the preliminary prediction result to obtain a final prediction result of the auxiliary examination items of the hospitalized patient.

[0014] Preferably, step (2) specifically comprises: first, cleaning and deduplicating the obtained source data of the hospitalized patient to obtain the preliminarily processed source data; then, performing keyword segmentation and data desensitization processing on the preliminarily processed source data in sequence to obtain the secondarily processed source data; subsequently, extracting the required feature item data from the secondarily processed source data, and performing feature coding on the feature item data through the coding mode corresponding to the feature item data, so as to finally obtain the preprocessed source data.

[0015] The coding mode of the feature item data is:

[0016] For the feature item data of the gender feature, the one-hot encoding is used to convert it into a binary feature coding result.

[0017] For the feature item data of the age feature, it is necessary to classify according to the distribution of inpatients in different age stages, and then to conduct one-hot encoding on each age stage to obtain the feature encoding result.

[0018] For the feature item data including the admission reason feature and the preliminary diagnosis feature (which is multi-label), first, all labels of the feature item data are extracted to obtain a label list, then the labels in the label list are traversed one by one, and the corresponding encoding of each label is obtained in the pre-established feature encoding table, and finally the corresponding encodings of all labels are summarized to obtain the feature encoding result of the feature item data.

[0019] Preferably, the feature encoding table is established according to the following steps: first, all labels of each feature item data are extracted from a large amount of sample data and summarized to obtain a corresponding label list, then the label list is de-duplicated and normalized to obtain a standardized label list, and finally the standardized label list is custom-encoded to obtain the feature encoding table corresponding to the feature item data.

[0020] The auxiliary examination encoding table is established according to the following steps: first, all different labels of each auxiliary examination data are extracted from a large amount of sample data and summarized to obtain a corresponding auxiliary examination label list (which summarizes all different auxiliary examination item names), then the auxiliary examination label list is de-duplicated and normalized to obtain a standardized auxiliary examination label list, and finally each label in the standardized auxiliary examination label list is assigned a custom encoding starting with the letter "E" followed by three digits to obtain the auxiliary examination encoding table corresponding to the auxiliary examination data.

[0021] Preferably, the auxiliary examination item prediction model includes a data processing module and a random forest classification prediction model.

[0022] The input of the data processing module is the source data of the inpatient, and the output is the preprocessed source data, which includes a three-layer structure.

[0023] The input of the first layer is the obtained source data of the inpatient, which performs data cleaning and de-duplication processing on the source data, and outputs the preliminarily processed source data.

[0024] The input of the second layer is the preliminarily processed source data output by the first layer, which performs content segmentation and data desensitization on the source data, and outputs the secondarily processed source data.

[0025] The input of the third layer is the secondarily processed source data output by the second layer, which performs feature data encoding on the source data, and outputs the preprocessed source data.

[0026] Preferably, the random forest classification prediction model comprises a plurality of individual decision trees, and an input of the random forest classification prediction model is the preprocessed source data output by the data processing module, and an output is a prediction result of the auxiliary examination item.

[0027] The random forest classification prediction model comprises a three-layer structure.

[0028] An input of the first layer is the preprocessed source data output by the data processing module, and the first layer performs feature extraction, data set division, data separation and the like on the source data, and outputs data sets such as training set feature data, training set target variable, test set and validation set.

[0029] An input of the second layer is the training set feature data and the training set target variable output by the first layer, and the second layer constructs a plurality of individual decision trees based on the classification and regression tree (CART) method and according to the training set feature data and the training set target variable, and outputs each individual decision tree, which comprises its own splitting structure and prediction result.

[0030] An input of the third layer is the plurality of individual decision trees constructed by the second layer, and the third layer integrates and combines the prediction results to output a prediction result of the auxiliary examination item.

[0031] Preferably, the first layer of the data processing module first sorts the source data of the inpatient according to the hospitalization number to form an Excel list, then deletes missing data and blank rows in the Excel list by using the dropna() method of the pandas library of python, then performs a de-duplication process on the Excel list by using the drop_duplicates() method, and finally saves the de-duplicated Excel table as the source data after preliminary processing.

[0032] The second layer of the data processing module first removes all spaces and line breaks in the source data after preliminary processing by using the replace() method of the pandas library of python, then obtains the index of the target keyword in the source data by using the find() method, and divides the long natural language in the source data into a plurality of data item lists by using the obtained index, then stores all the data item lists in a new Excel table to obtain the source data after segmentation, and finally removes sensitive data columns such as names from the source data after segmentation to obtain a desensitized data set, which is a data set after secondary processing.

[0033] The third layer of the data processing module first extracts all feature data items in the source data after secondary processing, then encodes the feature data items by using different encoding methods according to different categories of the feature data items to obtain corresponding feature encoding results, and finally writes the feature encoding results back to the corresponding columns in the source data to obtain the preprocessed source data.

[0034] Preferably, the first layer of the random forest classification prediction model first extracts a feature dataset composed of multiple feature data from the preprocessed source data. Then, the feature dataset is divided into training set, validation set, and test set according to the proportion. Finally, the feature data and target variable in the training set are separated to obtain the training set feature data and training set target variable. For the three multi-label data items—admission reason data, preliminary diagnosis data, and auxiliary examination data—additional matrix processing is required before proceeding to the next dataset partitioning step. Specifically:

[0035] First, for multi-label data of different categories, query the corresponding feature encoding table to obtain the encoding list corresponding to the multi-label data of each category.

[0036] Then, for each category of multi-label data, a two-dimensional matrix is ​​created. The number of rows in the matrix is ​​equal to the total number of multi-label data for that category, with each row corresponding to one multi-label data. The number of columns in the matrix is ​​equal to the number of codes in the corresponding code list, with each column corresponding to one code.

[0037] Finally, for the multi-label data of each category, the corresponding two-dimensional matrix is ​​filled by: traversing the codes it contains, obtaining the sequence number of the code in the corresponding code list, and then setting the elements in the row of the multi-label data and the column of the code sequence number in the corresponding two-dimensional matrix to 1, and setting the other elements in the two-dimensional matrix to 0.

[0038] The second layer of the random forest classification prediction model first initializes the key parameters of the individual decision trees. Then, it uses bootstrap sampling to draw samples with replacement from the training set data to construct multiple individual decision trees. Subsequently, during the splitting process at each node of each individual decision tree, a subset of features is randomly selected from all features to calculate the Gini index, and the feature that minimizes the Gini index is selected for splitting to determine the optimal splitting feature. Next, for the obtained optimal splitting feature, a list of all corresponding candidate splitting points is generated. Each candidate splitting point in this list is traversed, its corresponding Gini index is calculated, and the candidate splitting point with the smallest Gini index is selected as the optimal splitting point for the current node. Afterward, based on the selected optimal splitting feature and optimal splitting point, the samples of the current node are divided into multiple child nodes, and the aforementioned feature selection and splitting process is recursively performed on each child node until the stopping condition is met. When the splitting stopping condition of an individual decision tree is met, the current node becomes a leaf node, and the prediction results of the samples in that node are stored in the form of a binary two-dimensional matrix as the prediction result. The construction of this individual decision tree is then complete.

[0039] The third layer of the random forest classification prediction model first integrates all the constructed individual decision trees into a random forest, then obtains a coding list corresponding to the auxiliary examination data according to the auxiliary examination coding table, then for each coding in the coding list, the prediction results of the coding in all individual decision trees of the random forest are counted, the prediction result with the highest occurrence frequency is selected as the final prediction result of the coding corresponding label, and finally the prediction results of all codings are summarized, and the existing codings are taken as the prediction results of the auxiliary examination items.

[0040] Preferably, the auxiliary examination item prediction model is obtained by the following steps:

[0041] (3-1) Obtain an original data set composed of electronic medical record data of a plurality of hospitalized patients. The original data set is preprocessed, and the preprocessed data set is subjected to a data enhancement operation to obtain a data-enhanced data set.

[0042] (3-2) The data-enhanced data set obtained in step (3-1) is subjected to feature extraction and matrix processing to obtain a matrix-processed data set.

[0043] (3-3) The matrix-processed data set obtained in step (3-2) is divided into a training set, a validation set and a test set, and the training set feature data and the training set target variable are further separated from the training set.

[0044] (3-4) The parameters of the individual decision tree are initialized to obtain an initialized individual decision tree.

[0045] (3-5) The training set feature data and the training set target variable obtained in step (3-3) are subjected to bootstrap random sampling to construct a plurality of individual decision trees in parallel.

[0046] (3-6) For each individual decision tree constructed in step (3-5), first select a preliminary diagnosis feature with the most decision-making influence from its current node, then randomly select 1 feature from all other features of the current node, calculate the Gini index corresponding to the two selected features, and select the feature with the smallest Gini index as the best split feature of the current node of the individual decision tree.

[0047] (3-7) For each individual decision tree constructed in step (3-5), according to the best split feature of the current node of the individual decision tree selected in step (3-6), generate a list of all candidate split points corresponding thereto, traverse each candidate split point in the list, calculate the Gini index corresponding thereto, and select the candidate split point with the smallest Gini index as the best split point of the current node of the individual decision tree.

[0048] (3-8) For each individual decision tree constructed in step (3-5), the best split feature of the current node of the individual decision tree is selected according to step (3-6), and the best split point of the current node of the individual decision tree is obtained according to step (3-7), and the samples of the current node of the individual decision tree are divided into left node and right node.

[0049] (3-9) For each individual decision tree constructed in step (3-5), the above steps (3-6) to (3-8) are repeatedly executed recursively on the individual decision tree until a preset end condition is reached, thereby obtaining the constructed individual decision tree.

[0050] (3-10) All individual decision trees constructed in step (3-9) are integrated into a random forest as a preliminary trained random forest classification prediction model.

[0051] (3-11) The random forest classification prediction model preliminarily trained in step (3-10) is verified using the test set obtained in step (3-3) to obtain performance analysis results of the model, and the parameters of the random forest classification prediction model are adjusted according to the performance analysis results and cross-validated to obtain a finally trained random forest classification prediction model.

[0052] Preferably, step (3-2) specifically comprises: first extracting gender data, age data, admission reason data, preliminary diagnosis data, auxiliary examination data and other feature item data from the data set obtained after data augmentation in step (3-1); then, for each multi-label data (including admission reason data, preliminary diagnosis data and auxiliary examination data), a corresponding two-dimensional matrix is created for the multi-label data, thereby obtaining a matrixed data set.

[0053] Step (3-2) further comprises: for each category of multi-label data, a two-dimensional matrix is created, i.e. a two-dimensional matrix is created for each of the three categories of multi-label data, i.e. admission reason data, preliminary diagnosis data and auxiliary examination data. The number of rows of the two-dimensional matrix is equal to the total number of multi-label data of the category, and each row corresponds to a multi-label data. The number of columns of the matrix is equal to the number of encodings in the corresponding encoding list, and each column corresponds to an encoding.

[0054] Step (3-3) specifically comprises: first, the data set is randomly sampled in a ratio of 7:2:1 to divide into a training set, a validation set and a test set; then, in the training set, the matrixed preliminary diagnosis data and admission reason data are further extracted to form the training set feature data, and the matrixed auxiliary examination item data is extracted to form the training set target variable.

[0055] The step (3-9) is specifically that, for each individual decision tree, the process of steps (3-6) to (3-8) is repeatedly repeated, so that the individual decision tree is continuously split until a preset maximum depth is reached or the number of samples of the current node is less than the minimum sample split number, at which time the current node becomes a leaf node, and the corresponding individual decision tree is completed.

[0056] The step (3-11) is specifically that, first, the performance indicators of the preliminary trained random forest classification prediction model on the validation set are obtained by calculating feature importance scores, drawing confusion matrices and the like, then the model parameters in step (3-4) are continuously adjusted according to the performance indicators, and the model training process of (3-5) to (3-10) is repeated for cross-validation to optimize the model, and finally the trained random forest classification prediction model is obtained.

[0057] According to another aspect of the present application, a system for predicting patient auxiliary examination items based on supervised learning is provided, comprising:

[0058] The first module is configured to obtain the electronic medical record of the inpatient, and store the electronic medical record and the corresponding hospitalization number in the form of an Excel table as source data of the inpatient.

[0059] The second module is configured to preprocess the source data of the inpatient obtained by the first module to obtain preprocessed source data.

[0060] The third module is configured to input the preprocessed source data of the second module into a pre-trained auxiliary examination item prediction model to obtain a preliminary prediction result of the auxiliary examination item of the inpatient, and decode the preliminary prediction result using a pre-established auxiliary examination coding table to obtain a final prediction result of the auxiliary examination item of the inpatient.

[0061] Overall, compared with the prior art, the above technical solutions conceived by the present application can achieve the following beneficial effects:

[0062] 1、The present application adopts steps (3-5) to (3-6), constructs multiple independent decision trees, and only needs to train part of the data for each tree, does not depend on a large amount of historical time series data, and can randomly select different samples and features for learning each time, so that the technical problem that the existing LSTM model cannot predict the auxiliary examination item of the early stage of the disease of the patient due to the training complexity and dependence on a large amount of historical time series data can be solved.

[0063] 2、The present application can solve the technical problems of the existing Bayesian classifier that the prediction result deviates due to ignoring the correlation between features and poor processing ability of complex data, by adopting steps (3-2) to (3-10), integrating multiple decision trees, and each tree considering the complex relationship between features during training without making independence assumption;

[0064] 3、The present application can solve the technical problems of the existing KNN method that the model robustness is poor due to high algorithm complexity and sensitivity to outliers under large-scale data, by adopting steps (3-5) to (3-10), randomly selecting samples and features during training, and effectively avoiding the interference of single outliers on model prediction through the prediction of multiple decision trees;

[0065] 4、The present application can solve the technical problems of the existing reinforcement learning method that the model training process consumes a lot of resources and lacks interpretability due to high requirements for data type and data set size and complex reward mechanism design, by adopting steps (3-6) to (3-8), relatively simple training process, and splitting rules of each tree based on intuitive and transparent indicators (such as Gini index, information gain, etc.), and without the need to design a complex reward mechanism;

[0066] 5、The present application determines the data source as large medical institutions, guarantees the data volume support and the authenticity and effectiveness of the data, determines the target group as inpatients, guarantees the electronic medical record data quality, determines the data format as Excel table form, which is friendly to data providers, and can establish unified data standards and interfaces;

[0067] 6、The present application adopts the feature engineering technology in step (2), selects multi-dimensional and multi-label feature data, and proposes an encoding table mode with strong generalization and fault tolerance in feature data encoding, fully utilizing the diagnosis data and symptom data in electronic medical records. BRIEF DESCRIPTION OF DRAWINGS

[0068] Figure 1 is a method flow diagram of the present application based on supervised learning to predict patient auxiliary examination items;

[0069] Figure 2 is a system framework diagram of the present application;

[0070] Figure 3 is a model structure diagram of the random forest classification prediction model based on supervised learning of the present application;

[0071] Figure 4is a training process schematic diagram of an auxiliary examination item prediction model of the present application;

[0072] Figure 5 is a comparison schematic diagram of original data and segmented data after processing of the present application;

[0073] Figure 6 is a comparison schematic diagram of data before and after feature encoding of the present application;

[0074] Figure 7 is an accuracy line graph of auxiliary examination item label prediction results of the present application;

[0075] Figure 8 is a confusion matrix schematic diagram of the present application;

[0076] Figure 9 is a multi-model performance comparison bar chart of the present application. DETAILED DESCRIPTION

[0077] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0078] The purpose of the present application is to predict the auxiliary examination items of patients according to electronic medical records, so there are certain specific requirements for medical record data in the research process, that is, the patients recorded in the electronic medical record have undergone auxiliary examination. According to the statistical analysis of the electronic medical record data of patients in the cardiovascular department of a large third-grade class-A hospital, the auxiliary examination demand of inpatients reached tens of thousands of times per month in the four months of autumn and winter in 2023, which is much higher than the auxiliary examination demand of regular outpatients. The auxiliary examination demand of inpatients is more guaranteed and the demand is greater, so the research of the present application based on the electronic medical record data of inpatients has greater data friendliness and greater research value. Therefore, the present application has certain target group specificity, that is, inpatients.

[0079] Through observation and analysis of a large number of electronic medical record data of inpatients, it is found that the records of most electronic medical records always follow the following basic diagnosis and treatment process: first record the personal information of the patient, then inquire about the symptoms and disease history, then the doctor gives the preliminary diagnosis, and finally the diagnosis and treatment plan is given according to the examination result. Therefore, even if the medical record styles of different departments or different medical institutions are different, some common data forms can still be captured according to the basic diagnosis and treatment process. The present application has studied the medical office system of the data providing source in detail, and a single outpatient process mainly includes seven processes of disease inquiry, physical examination, special examination, preliminary diagnosis, auxiliary examination, differential diagnosis and diagnosis and treatment scheme. Correspondingly, all the detailed information in the electronic medical record of the patient will also be recorded along with the outpatient process. After investigating many new medical institutions, it is found that no matter how different the diagnosis and treatment systems of different medical institutions are, and no matter how different the electronic medical record styles are, the content of the entire electronic medical record must at least include patient information, admission reason, preliminary diagnosis, auxiliary examination, diagnosis and treatment plan and the like. This provides a great general reference value for the feature data selection of the present application.

[0080] In terms of feature selection, an electronic medical record data records the detailed situation of the diagnosis and treatment process of the patient, including 16 items of content such as hospitalization number, gender, age, admission department, ward, bed number, admission time, admission reason, patient profile, current illness history, past history, auxiliary examination, preliminary diagnosis, diagnosis basis, differential diagnosis and diagnosis and treatment plan. The purpose of the present application is to predict the auxiliary examination that the patient needs to do according to the medical record information, so the features that have greater influence on this aspect need to be considered, such as medical history information, preliminary diagnosis and admission reason, and irrelevant items such as admission department, diagnosis and treatment plan and bed number are screened out. According to the requirements of text complexity and method universality, some data items that may be missing records or extremely difficult to handle in different medical institutions such as medical history information are removed. Finally, the feature selection is determined as: gender, age, admission reason and preliminary diagnosis, a total of four dimensions.

[0081] In terms of model selection and training, a method based on random forest classification is selected to construct and train the prediction model. In predicting the auxiliary examination item, multi-dimensional and multi-label features are involved, including the gender, age, admission reason and preliminary diagnosis of the patient, which constitute a high-dimensional feature space. Random forest can effectively handle high-dimensional features, because when constructing each node of the individual decision tree, it will randomly select a part of features from a large number of features for evaluation to find the optimal feature and segmentation point.

[0082] It is worth noting that, considering the non-complete correspondence of diseases and symptoms (different departments of diseases may have the same symptoms, such as "dizziness" may be caused by cardiovascular diseases, may be caused by neurosurgery diseases, and may be caused by cardiovascular diseases), different models need to be trained according to different departments of medical institutions (cardiovascular department, urology department, neurosurgery department, traditional Chinese medicine department, etc.). In this specification, the cardiovascular department is mainly taken as an example for illustration, and other departments can be processed similarly.

[0083] As shown in Figure 1 The present application provides a method for predicting patient auxiliary examination items based on supervised learning, comprising the following steps:

[0084] (1) Obtain the electronic medical record of the inpatient, and store it and the corresponding hospitalization number (which plays a unique identification role) in the form of an Excel table as the source data of the inpatient.

[0085] Specifically, the electronic medical record of the inpatient is obtained through the electronic medical record system of the medical institution.

[0086] The prerequisite for selecting the electronic medical record in this step is that the patient needs auxiliary examination. At present, the present application is more targeted at inpatients, because inpatients have a greater demand for auxiliary examination.

[0087] The advantage of this step (1) is that the data is simple and direct to obtain through the electronic medical record system of the medical institution. The medical institution stores a large amount of electronic medical record information of inpatients, most of which are recorded in detail, the data quality is high, and new data is constantly being generated. This is of great advantage to offline training of the model.

[0088] (2) Preprocess the source data of the inpatient obtained in step (1) to obtain preprocessed source data.

[0089] This step specifically includes the following steps. First, the obtained source data of the inpatient is cleaned and de-duplicated (the data with missing or repeated parts is deleted) to obtain the source data after preliminary processing. Then, the source data after preliminary processing is subjected to keyword segmentation and data desensitization processing (i.e., the long natural language content in the data is segmented into multiple column data items, and sensitive data content such as patient name is removed) to obtain the source data after secondary processing. Then, the required feature item data (such as gender feature, age feature, admission reason feature, and preliminary diagnosis feature) is extracted from the source data after secondary processing, and the feature item data is encoded (i.e., the Chinese natural language data is converted into encoded data) through the corresponding encoding mode of the feature item data. The final source data is the preprocessed source data.

[0090] The encoding mode of the feature item data of the present application is:

[0091] For the feature item data of gender characteristics, a one-hot encoding is used to convert it into a binary (male 1 and female 0) feature encoding result to avoid the influence of the order relationship between genders on the training process of the auxiliary examination item prediction model.

[0092] For the feature item data of age characteristics, it is necessary to classify according to the distribution of inpatients in different age stages, and then perform one-hot encoding on each age stage to obtain the feature encoding result. Taking the department of cardiovascular medicine as an example, the present application marks the age below 50 years old as 0, marks the age of 50-65 years old as 1, marks the age of 66-80 years old as 2, and marks the age above 80 years old as 3.

[0093] And for the feature item data of admission reason characteristics and preliminary diagnosis characteristics, since it is multi-label (referring to one data item corresponding to multiple label data, such as one preliminary diagnosis data containing "hypertension" and "heart disease" two diagnosis results, that is, this data contains "hypertension" and "heart disease" two labels, and this preliminary diagnosis data is multi-label), first, all the labels of the feature item data are extracted to obtain a label list, then the labels in the label list are traversed one by one, and the corresponding encoding of each label is obtained in the pre-established feature encoding table, and finally the corresponding encodings of all labels are summarized to obtain the feature encoding result of the feature item data.

[0094] Furthermore, the feature encoding table of the present application is established according to the following steps:

[0095] First, all the labels of each feature item data are extracted from a large amount of sample data and summarized to obtain a corresponding label list, then the label list is de-duplicated and normalized to obtain a standardized label list, and finally the standardized label list is self-defined encoded to obtain the feature encoding table corresponding to the feature item data.

[0096] The advantage of this step (2) is that the data provider only needs to provide source data in Excel form without the need for more additional processing, so that the pre-processing operation of the data can be carried out in a higher standardized and systematic manner, and is more friendly to the data provider. At the same time, through the standardized data cleaning, encoding and feature extraction process, it is ensured that all data items can be uniformly and normatively input into the model. This reduces manual intervention and errors, and makes the data processing process repeatable, scalable, and easy to update and maintain. In addition, this data preprocessing method can adapt to the data characteristics of different departments and has good universality.

[0097] (3) inputting the source data preprocessed in step (2) into the pre-trained auxiliary examination item prediction model to obtain the preliminary prediction result of the auxiliary examination item of the inpatient (the prediction result is in the form of coding), and using the pre-established auxiliary examination coding table to decode the preliminary prediction result (convert the coding form data into text data) to obtain the final prediction result of the auxiliary examination item of the inpatient (which is in the form of natural language text).

[0098] Specifically, the auxiliary examination coding table of the present application is established according to the following steps:

[0099] Firstly, all different labels of each auxiliary examination data (the label of the auxiliary examination data is the specific examination item name) are extracted from a large amount of sample data and summarized to obtain a corresponding auxiliary examination label list (which summarizes all different auxiliary examination item names), then the auxiliary examination label list is de-duplicated and standardized to obtain a standardized auxiliary examination label list, and finally each label in the standardized auxiliary examination label list is assigned a self-defined code starting with the letter "E" followed by three digits to obtain the auxiliary examination coding table corresponding to the auxiliary examination data.

[0100] The advantage of this step (3) is that through the automatic processing and standardized coding mechanism, the manual intervention is reduced, the error risk is reduced, and the efficiency and accuracy of data processing can be significantly improved. At the same time, the unified coding table management improves the cross-department adaptability and expandability of the system, facilitates the processing of multi-label information of different data sources, and supports subsequent expansion and maintenance.

[0101] The auxiliary examination item prediction model of the present application includes a data processing module and a random forest classification prediction model.

[0102] As shown in Figure 2 , the input of the data processing module of the present application is the source data of the inpatient, and the output is the preprocessed source data, which includes three layers of structure:

[0103] The first layer inputs the obtained source data of the inpatient, performs data cleaning and de-duplication processing on the source data, and outputs the preliminarily processed source data.

[0104] Specifically, the first layer first sorts the source data of the inpatient according to the hospitalization number to form an Excel list, then uses the dropna() method of the pandas library of python to delete the missing item data and blank rows in the Excel list, then uses the drop_duplicates() method to de-duplicate the Excel list, and finally saves the de-duplicated Excel table as the preliminarily processed source data.

[0105] The second layer input is the preliminary processed source data of the first layer output, which performs content segmentation and data desensitization on the source data, and outputs the secondary processed source data.

[0106] Specifically, the second layer first removes all spaces and line breaks in the preliminary processed source data using the replace() method of the pandas library in python, then obtains the index of the target keywords (the present application uses the keywords "hospitalization number", "gender", "age", "initial diagnosis", "admission reason", "auxiliary examination", etc.) in the source data through the find() method, and uses the obtained index to divide the large amount of natural language in the source data into a plurality of data item lists, then stores all data item lists into a new Excel table to obtain the segmented processed source data, and finally removes sensitive data columns such as names from the segmented processed source data to obtain the desensitized data set, which is the secondary processed data set.

[0107] As shown in Figure 5 The electronic medical record raw data of the hospitalized patient composed of a large amount of natural language and the comparison after content segmentation and data desensitization processing are shown.

[0108] The input of the third layer is the secondary processed source data output by the second layer, which performs feature data encoding on the source data, and outputs the preprocessed source data.

[0109] Specifically, the third layer first extracts all feature data items in the secondary processed source data, then encodes the feature data items using different encoding methods for different categories of feature data items to obtain the corresponding feature encoding results, and finally writes the feature encoding results back to the corresponding columns in the source data to obtain the preprocessed source data.

[0110] Furthermore, the encoding method of the feature data of the present application is performed according to the following steps:

[0111] For the feature item data of the gender feature, the one-hot encoding is used to convert it into binary (male 1 and female 0) feature encoding results, so as to avoid the influence of the order relationship between genders on the training process of the auxiliary examination item prediction model.

[0112] For the feature item data of the age feature, it needs to be classified according to the distribution of hospitalized patients at different age stages, and then one-hot encoding is performed on each age stage to obtain the feature encoding results. Taking the department of cardiovascular medicine as an example, the present application marks the age below 50 years old as 0, 50-65 years old as 1, 66-80 years old as 2, and over 80 years old as 3.

[0113] As for the multi-label characteristic item data of the admission reason feature and the preliminary diagnosis feature, since it is multi-label, first, all labels of the characteristic item data are extracted to obtain a label list, then the labels in the label list are traversed one by one, and the corresponding encoding of each label is obtained in the pre-established characteristic encoding table, and finally the corresponding encoding of all labels is summarized to obtain the characteristic encoding result. As shown in Figure 6 The data example comparison chart before and after the feature encoding of the present application is shown.

[0114] Taking the characteristic item data of the preliminary diagnosis feature as an example, in the sample data after the secondary processing, the characteristic item data is in the form of a long sentence of natural language separated by numbers and points. First, the points are keyword indexed, and the long sentence content is decomposed to obtain a plurality of disease name labels, then the disease name labels are summarized to obtain a corresponding label list, and finally each disease name label in the label list is assigned an encoding starting with the letter "D" followed by three digits to obtain a disease name encoding table corresponding to the preliminary diagnosis feature. Similar processing methods are also applicable to the admission reason and auxiliary examination features. The present application realizes three encoding tables of the admission reason encoding table, the disease name encoding table and the auxiliary examination encoding table.

[0115] It is worth noting that after preliminary sorting, the disease name encoding table contains a large number of labels, which may cause data sparsity problems. Therefore, the disease name encoding table data needs to be thoroughly combed to ensure that all possible disease names are covered, and further coding assimilation is needed, that is, the encoding of various synonyms and abbreviations is unified, and the disease classification items with little difference in examination items are unified. For example, taking the disease name encoding table of the cardiovascular internal medicine department as an example, "coronary atherosclerotic heart disease" is sometimes also referred to as "coronary heart disease", which needs to be set as the same label or the same encoding; for example, "heart function II" and "heart function III", the examinations needed are almost the same, that is, blood test and electrocardiogram, which can be set to the same disease encoding. The processing of the present application is carried out under the guidance of professional and scientific medical treatment. After processing, the disease encoding of the cardiovascular internal medicine department is determined as 78 items, covering more than three hundred different names of cardiovascular diseases.

[0116] As shown in Figure 3 The random forest classification prediction model of the present application includes a plurality of individual decision trees, which are independent of each other and jointly constitute a powerful supervised learning model. The input of the random forest classification prediction model is the preprocessed source data output by the data processing module, and the output is the prediction result of the auxiliary examination item (which is in the form of encoding).

[0117] The random forest classification prediction model includes the following three layers of structure:

[0118] The input of the first layer is the preprocessed source data output by the data processing module, which performs feature extraction, data set division, data separation, etc. on the source data, and outputs training set feature data, training set target variable, test set and validation set, etc.

[0119] Specifically, the first layer first extracts a feature data set composed of multiple feature data (including gender data, age data, admission reason data, preliminary diagnosis data, auxiliary examination data, etc.) from the preprocessed source data (the data in the feature data set is in the form of encoding), then divides the feature data set into a training set, a validation set and a test set according to a certain proportion (such as commonly used 70%-80% as a training set, and the rest as a validation set and a test set), and finally separates the feature data and the target variable in the training set to obtain the training set feature data and the training set target variable.

[0120] It is worth noting that the feature data set of the present application is multi-dimensional and contains multi-label data. For the three multi-label data of admission reason data, preliminary diagnosis data and auxiliary examination data, additional matrix processing is required before the next data set division. Specifically:

[0121] First, for different categories of multi-label data (i.e. admission reason data, preliminary diagnosis data, auxiliary examination data), the corresponding feature code table (i.e. admission reason code table, disease name code table, auxiliary examination code table) is queried to obtain the code list corresponding to each category of multi-label data (containing a serial number column and a corresponding code column, each code in the code list corresponds to a label).

[0122] Then, for each category of multi-label data, a two-dimensional matrix is created (i.e. a two-dimensional matrix needs to be created for each of the three categories of multi-label data: admission reason data, preliminary diagnosis data, and auxiliary examination data), the number of rows of the matrix is equal to the total number of multi-label data of the category, each row corresponds to a multi-label data, the number of columns of the matrix is equal to the number of codes in the corresponding code list, each column corresponds to a code. For example, for 1000 preliminary diagnosis data, if the corresponding code list obtained from the disease name code table has 50 disease name codes, the size of the matrix is 1000x50, each row of the matrix corresponds to a preliminary diagnosis data, and each column corresponds to a disease name code.

[0123] Finally, for each category of multi-label data, a filling operation is performed on the corresponding two-dimensional matrix.

[0124] Specifically, for each multi-label data (which is in the form of encoding) of the category, the encoding contained therein is traversed, and the sequence number of the encoding is obtained in the corresponding encoding list, and then the element in the corresponding two-dimensional matrix at the row where the multi-label data is located and the column where the sequence number of the encoding is located is set to 1, and other elements in the two-dimensional matrix are set to 0. For example, a preliminary diagnosis data is "pneumonia" and "hypertension", the corresponding encoding sequence number of "pneumonia" in the encoding list is 3, and the corresponding encoding sequence number of "hypertension" is 7, then in the corresponding two-dimensional matrix of the preliminary diagnosis data, the elements in the 3rd column and the 7th column of the row where the preliminary diagnosis data is located are set to 1, and the elements in the remaining columns are set to 0.

[0125] The input of the second layer is the training set feature data and the training set target variable of the output of the first layer, and a plurality of individual decision trees (which are the basic building units of the random forest classification prediction model, and gradually form a tree structure as they continue to grow) are constructed and output based on the classification and regression tree (CART) method and according to the training set feature data and the training set target variable. Each individual decision tree includes its own splitting structure and prediction result.

[0126] Specifically, the second layer first initializes key parameters of individual decision trees (including maximum depth, minimum sample split number, minimum leaf node sample number, etc.), which determine the growth process and final shape of individual decision trees and can be continuously optimized during model training. Then, bootstrap sampling is used to extract samples from the training set data (including training set feature data and training set target variable) with replacement (for example, for a training set with n samples and m features, n samples (possibly with repetition) are extracted each time) to construct multiple individual decision trees (the root nodes of individual decision trees store all extracted samples). Subsequently, in the splitting process of each node of each individual decision tree, a portion of features is randomly selected from all features (gender, age, reason for admission, preliminary diagnosis, etc.) to calculate the Gini index, and the feature with the smallest Gini index is selected for splitting to determine the best split feature. Then, for the obtained best split feature, a list of all candidate split points (a split point is the core of the individual decision tree splitting process, which determines how to divide the samples of the current node into different child nodes according to the value of a certain feature, and its value is the different values or labels of the corresponding feature) is generated, each candidate split point in the list is traversed, its corresponding Gini index is calculated, and the candidate split point with the smallest Gini index is selected as the best split point of the current node. Thereafter, according to the selected best split feature and best split point, the samples of the current node are divided into multiple child nodes, and the aforementioned feature selection and splitting process is recursively performed on each child node until the stopping condition is met (the stopping condition is any one of the following three points: the node reaches the set maximum depth, the number of samples in the current node is less than the minimum sample split number, and the samples in the node all belong to the same category). When the splitting stopping condition of an individual decision tree is met, the current node becomes a leaf node, and the prediction results of the samples in the node are stored as a binary two-dimensional matrix as the prediction results (each row of the matrix corresponds to a sample in the leaf node, each column of the matrix corresponds to a label of the target variable, and "1" represents the prediction of the existence of the label, and "0" represents the prediction of the non-existence of the label), and the construction of the individual decision tree is completed. Thus, multiple complete individual decision trees are obtained.

[0127] Notably, for the above process of randomly selecting features, due to the large difference in data feature dimensions and uneven importance distribution of the present application, the preliminary diagnosis feature with the most decision-making influence is preferentially selected, and then a feature is randomly selected from all other features (gender, age, reason for admission, etc.).

[0128] Furthermore, since the feature data items in this invention have multiple labels, and the feature data with multiple labels has been matrixed (each row of the matrixed feature data represents a data sample, and each column represents a feature label), additional processing is required for calculating the Gini index of features with multiple labels during node splitting, as follows:

[0129] First, for each label in the feature data for this feature, calculate the Gini index. Assuming there are L labels in the feature data, then for label L... i (The i-th label corresponds to the i-th column in the matrixed feature data), calculate the proportion of samples with the label 0 (p0) and the proportion of samples with the label 1 (p1), and then use the following formula to obtain the Gini index (L) for this label. i ):

[0130]

[0131] Subsequently, the Gini index L for each label in the feature data of this feature. i Perform a weighted average to obtain the overall Gini index of this feature for the current node. node This refers to the Gini index, which represents this characteristic. The specific formula is as follows:

[0132]

[0133] Finally, during the individual decision tree splitting process, the optimal splitting feature is selected based on the Gini index of each feature (i.e., the feature with the smallest Gini index is selected).

[0134] The input to the third layer is the constructed individual decision tree output from the second layer. It integrates and combines the prediction results, and outputs the prediction results of the auxiliary inspection items (which are in coded form).

[0135] Specifically, the third layer first integrates all the constructed individual decision trees into a random forest. Then, it obtains the code list corresponding to the auxiliary inspection data based on the auxiliary inspection coding table (containing a sequence number column and the corresponding code column, with each code in the list corresponding to an auxiliary inspection label, which is also the label of the target variable). Subsequently, for each code in the coding list, it counts the prediction results of that code in all individual decision trees of the random forest (the prediction results are in binary form, "1" represents existence and "0" represents non-existence). The prediction result with the most occurrences (i.e., the one with more occurrences of "1" and "0") is selected as the final prediction result of the label corresponding to that code (i.e., the final prediction result is the "majority vote" of all tree prediction results). Finally, it summarizes the prediction results of all codes and uses the code that is predicted to exist (i.e., the final prediction result is "1") as the prediction result of the auxiliary inspection item.

[0136] For example, the target variable has 3 labels (corresponding to encoding A, B, C), and there are 5 individual decision trees in the random forest, and the prediction result of each individual decision tree for a sample is:

[0137] Individual decision tree 1: [1, 0, 1]

[0138] Individual decision tree 2: [0, 1, 1]

[0139] Individual decision tree 3: [1, 0, 0]

[0140] Individual decision tree 4: [1, 1, 1]

[0141] Individual decision tree 5: [0, 0, 1]

[0142] For label A, the prediction results of the five individual decision trees are 1, 0, 1, 1, and 0, respectively, that is, 3 individual decision trees predict that label A exists, and 2 individual decision trees predict that label A does not exist, so the final prediction result of label A is 1 (label A exists). Similarly, the final prediction result of label B is 0 (label B does not exist), and the final prediction result of label C is 1 (label C exists). Therefore, the final prediction result is [1, 0, 1], and the output prediction result is [A, C].

[0143] It is worth noting that the present application also uses a series of numerical analysis and visualization methods to evaluate the performance of the model. The main performance evaluation and optimization methods include the following three:

[0144] The first is the prediction accuracy evaluation. For the prediction of the auxiliary examination item, since the target output is multi-label and the labels of the auxiliary examination are specific examination items, the macro-averaged accuracy is used for evaluation. The steps for calculating the macro-averaged accuracy are as follows:

[0145] a. For a specific sample data, compare its prediction result (several examination encodings) with the actual examination encoding of the sample. If there is the same examination encoding, it is considered that the corresponding label prediction is accurate.

[0146] b. Statistics of all prediction cases are obtained to obtain the actual prediction amount of each label.

[0147] c. Compare the actual prediction amount of each label with the amount of data of the label in the sample to obtain the prediction accuracy of the label.

[0148] d. Macro-averaged accuracy = (accuracy of label 1 + accuracy of label 2 +... + accuracy of label n) / n.

[0149] The second item is performance evaluation. The application uses various evaluation indicators (confusion matrix, recall rate, AUC value, F value, etc.) to comprehensively evaluate the performance of the model. According to the evaluation results, the hyperparameters of the model can be adjusted, such as the number of individual decision trees, the maximum depth of the tree, the minimum sample partition number, etc., to further optimize the performance of the model.

[0150] The third item is to perform feature importance scoring. Through the evaluation of feature importance, it can be found out which features have the greatest impact on the prediction results of the model, so that the feature weights can be reasonably adjusted, and the basis for subsequent feature selection and model optimization can be provided.

[0151] In summary, the random forest classification prediction model used in the application can accurately predict the required auxiliary examination items of the patient by effectively processing and supervised learning of the electronic medical record data of the hospitalized patient, and provide valuable reference for medical decision-making.

[0152] As shown in Figure 4 The auxiliary examination item prediction model of the application is obtained by the following steps:

[0153] (3-1) Obtain an original data set composed of electronic medical record data of a plurality of hospitalized patients (in this example, a total of 3895 electronic medical record data of hospitalized patients in the cardiovascular internal medicine department, each electronic medical record data is uniquely identified by the hospitalization number, and is stored in the form of an Excel table). The original data set is preprocessed, and the preprocessed data set is subjected to a data enhancement operation to obtain a data enhanced data set.

[0154] It should be noted that the pre-processing process of the original data set in this step is exactly the same as the above step (2), and will not be repeated here.

[0155] In addition, although the supervised learning algorithm based on random forest used in the application has certain anti-overfitting ability, the basic unit individual decision tree may still overfit the training data when the data volume is insufficient. Therefore, when the data volume is small, the individual decision tree may remember the details and noise of the training samples instead of learning the real data pattern, resulting in a decline in the performance of the model on the test set or new data. Therefore, the application also uses data enhancement technology to generate more sample data.

[0156] Further, the present application has established a more reliable admission reason coding table. Since the disease and the symptoms at the time of onset are in a many-to-many relationship, some common symptoms of diseases in the department category can be added to the admission reason data item of the data set to expand the data set. In this example, the common symptoms of cardiovascular diseases include "chest pain", "dyspnea", "syncope", "palpitations", "fatigue", etc. Therefore, these common symptoms can be randomly added to the admission reason data to achieve the purpose of data expansion. The 3895 original data in this example obtained 3761 valid coding data after processing, and a total of 8000 valid data were obtained after data enhancement. The data of other departments can also be processed similarly. This step can effectively enhance the data.

[0157] The sub-step (3-10) has the advantage that the data set can be effectively expanded by data enhancement technology, thereby avoiding overfitting of the model to limited data during training. Especially when using an algorithm based on random forest, data enhancement helps to improve the generalization ability of the model and avoid the model "remembering" the details and noise of the training data. This method is also applicable to other departments, so it can enhance the diversity and size of data in different departments and ensure more extensive data applications.

[0158] (3-2) Perform feature extraction and matrix processing on the data set obtained after data enhancement in step (3-1) to obtain a matrixed data set.

[0159] Specifically, first, the gender data, age data, admission reason data, preliminary diagnosis data, auxiliary examination data and other feature item data are extracted from the data set obtained after data enhancement in step (3-1), and then for each multi-label data (including admission reason data, preliminary diagnosis data and auxiliary examination data), a corresponding two-dimensional matrix is created for the multi-label data, thereby obtaining a matrixed data set.

[0160] Further, for each category of multi-label data, a two-dimensional matrix is created (i.e. a two-dimensional matrix needs to be created for each of the three types of multi-label data: admission reason data, preliminary diagnosis data, and auxiliary examination data), the number of rows of the matrix is equal to the total number of multi-label data of the category, each row corresponds to a multi-label data, and the number of columns of the matrix is equal to the number of codes in the corresponding coding list, each column corresponds to a code.

[0161] Taking the preliminary diagnosis data as an example, assuming that the data set contains 8000 samples and 78 disease labels, an 8000x78 two-dimensional matrix can be created. For each sample, traverse its disease labels, if the label exists, fill 1 in the corresponding position of the matrix, otherwise fill 0.

[0162] The sub-step (3-2) has the advantage that through matrix processing, multi-label data (such as preliminary diagnosis data) can be converted into a high-dimensional feature space, and each label is processed as an independent dimension, which improves the fine-grained expression of the features. This not only provides more information for the model, but also simplifies the processing flow of multi-label data, avoids tedious manual labeling and conversion work, thereby improving the efficiency of data processing and the prediction performance of the model.

[0163] (3-3) Divide the matrix data set obtained in step (3-2) into a training set, a validation set and a test set, and further separate the training set feature data and the training set target variable from the training set.

[0164] Specifically, first, the data set is randomly sampled according to a ratio of 7:2:1 to divide it into a training set, a validation set and a test set; then, in the training set, the matrix preliminary diagnosis data and the admission reason data are further extracted to form the training set feature data, and the matrix auxiliary examination item data is extracted to form the training set target variable.

[0165] Further, assuming that the matrix training set is data_matrix, the first few columns are the training set feature data, and the last few columns are the training set target variable, then:

[0166] Training set feature data: X_train = data_matrix[:,:-num_target_cols)

[0167] Training set target variable: y_train = data_matrix[:,-num_target_cols:]

[0168] Here, num_target_cols represents the number of columns of the training set target variable.

[0169] It is worth noting that the training set in the present application is used to adjust the trainable weights and other parameter configurations in the auxiliary examination item prediction model, the validation set is used to adjust the learning rate and other hyperparameters of the auxiliary examination item prediction model, the test set does not participate in the training of the model, and is used to statistically evaluate the final prediction effect of the auxiliary examination item prediction model.

[0170] The sub-step (3-30 has the advantage that random sampling can effectively avoid data bias, ensure that each sample has a chance to be selected, provide a wider data distribution, and thus enable the training set to cover more sample features and enhance the robustness of the model.

[0171] (3-4) Initialize the parameters of the individual decision tree to obtain an initialized individual decision tree.

[0172] Specifically, the following parameters are set in this example:

[0173] n_estimators = 200: indicates that the random forest contains 200 decision trees.

[0174] max_depth = 10: the maximum depth of the decision tree is 10, which limits the growth depth of the tree.

[0175] min_samples_split = 2: stop further splitting when the number of samples in the current node is less than 2.

[0176] min_samples_leaf = 1: the leaf node needs to contain at least 1 sample.

[0177] The advantage of this sub-step (3-4) is that through such parameter setting, the complexity of the decision tree can be effectively controlled, preventing the tree from growing too deep and avoiding model overfitting. At the same time, ensuring that each leaf node contains at least 1 sample can ensure that each branch of the tree represents an actual class as much as possible.

[0178] (3-5) Bootstrap random sampling is performed on the training set feature data and the training set target variable obtained in step (3-3) to construct multiple individual decision trees in parallel.

[0179] When constructing each individual decision tree, 5600 samples are randomly drawn with replacement from the training set feature data.

[0180] The advantage of this sub-step (3-5) is that by randomly sampling the samples in the training set with replacement (i.e., bootstrap sampling), the data set seen by each individual decision tree during training is slightly different. This imperfect overlap of data improves the diversity of the model and helps to reduce the overfitting phenomenon that may occur in a single individual decision tree.

[0181] (3-6) For each individual decision tree constructed in step (3-5), first select the preliminary diagnostic feature with the most decision-making influence from the current node, then randomly select 1 feature from all other features (gender, age, reason for admission, etc.) in the current node, calculate the Gini index corresponding to the two selected features, and select the feature with the smallest Gini index as the best split feature for the current node of the individual decision tree.

[0182] The advantage of this sub-step (3-6) is that by prioritizing the most decision-relevant features, it can reduce redundancy and unnecessary computational overhead. By focusing on the features most relevant to the target variable, it not only reduces training time, but also reduces noise in the training process, thereby improving model efficiency and accuracy. This process of feature selection helps to improve the interpretability of the model and ensures that each individual decision tree learns using the most relevant data.

[0183] (3-7) For each individual decision tree constructed in step (3-5), based on the best split feature of the current node of the individual decision tree selected in step (3-6), a list of all candidate split points (candidate split points are all possible values or labels of the best split feature) corresponding to the candidate split points is generated, each candidate split point in the list is traversed, the corresponding Gini index is calculated, and the candidate split point with the smallest Gini index (i.e. the "purest" split point) is selected as the best split point of the current node of the individual decision tree.

[0184] Specifically, for the gender feature and the age feature in this example, the candidate split points are different values of the feature. For multi-label features such as admission reason and preliminary diagnosis, the candidate split points are a label or a combination of different labels of the feature. For example, for the "age" feature, the ages of all samples in this example are labeled as "0", "1", "2", "3", and the candidate split points are usually the "midpoints" of these labeled values, such as "1" or "2". For the preliminary diagnosis feature, the candidate split points can be "hypertension" (corresponding to whether the corresponding position in the matrix is "1") or a combination of "hypertension" and "heart disease" (corresponding to whether the corresponding positions in the matrix are both "1").

[0185] The advantage of this sub-step (3-7) is that based on the Gini index calculation method, it can more carefully evaluate the influence of each feature on the label. By calculating the Gini index of each label, it can more accurately quantify the contribution of different features to sample classification, thereby making more reasonable decisions in the construction of individual decision trees.

[0186] (3-8) For each individual decision tree constructed in step (3-5), based on the best split feature of the current node of the individual decision tree selected in step (3-6) and the best split point of the current node of the individual decision tree selected in step (3-7), the samples of the current node of the individual decision tree are divided into left and right nodes.

[0187] For example, if the age feature is selected and the split point is "30 years old", the samples of the current node will be divided into samples with age less than 30 years old and samples with age greater than or equal to 30 years old.

[0188] (3-9) For each individual decision tree constructed in step (3-5), recursively repeat the above steps (3-6) to (3-8) on the individual decision tree until a preset ending condition is reached, thereby obtaining the constructed individual decision tree.

[0189] Specifically, for each individual decision tree, each of its child nodes will continuously repeat the process of steps (3-6) to (3-8), so that the individual decision tree continuously splits until a preset maximum depth is reached or the number of samples of the current node is less than a minimum sample split number (in this example, the maximum depth is 10 and the minimum sample split number is 2), at which time the current node becomes a leaf node and the corresponding individual decision tree is completed.

[0190] The advantage of the present sub-step (3-9) is that the recursive process enables the depth and structure of the tree to be dynamically adjusted according to the actual situation of the data, avoiding over-simplification or over-complexity caused by a fixed depth, and ensuring that the individual decision tree can both capture complex patterns and avoid overfitting.

[0191] (3-10) Aggregate all the individual decision trees constructed in step (3-9) into a random forest as a preliminary trained random forest classification prediction model.

[0192] Specifically, for a new sample, each individual decision tree in the random forest classification prediction model will give a prediction result. The final prediction result is determined by a voting mechanism, i.e., selecting the prediction class that appears most frequently in all individual decision trees as the final prediction result.

[0193] The advantage of the present sub-step (3-10) is that through the voting mechanism of each individual decision tree, the random forest integrates the decisions of multiple trees, reducing the errors caused by overfitting or bias of a single tree.

[0194] (3-11) Verify the preliminary trained random forest classification prediction model of step (3-10) using the test set obtained in step (3-3) to obtain performance analysis results of the model, continuously adjust the parameters of the random forest classification prediction model according to the performance analysis results, and perform cross-validation to obtain a final trained random forest classification prediction model.

[0195] Specifically, first, the performance indicators (accuracy, F1 value, AUC value, etc.) of the preliminary trained random forest classification prediction model on the validation set are obtained by calculating feature importance scores, drawing confusion matrices, etc., then the model parameters in step (3-4) are adjusted according to the performance indicators, and the model training process of (3-5) to (3-10) is repeated for cross-validation to optimize the model, and the final trained random forest classification prediction model is obtained. For example, the number of decision trees can be adjusted, starting from 50, increasing by 50 to 500, and the optimal number of decision trees is determined according to the performance indicators.

[0196] The advantage of the present sub-step (3-11) is that multi-dimensional analysis and evaluation can comprehensively understand the performance of the model. At the same time, by analyzing the feature importance score, it can be identified which features are most critical in the decision-making process, which provides support for the interpretability of the model.

[0197] Experimental results

[0198] In order to illustrate the effectiveness of the method and the improvement of the classification effect, the prediction results of the auxiliary examination project of the test set data of the cardiovascular department of the invention are taken as an example to illustrate the effectiveness of the method.

[0199] Figure 7 The prediction results of each label of the auxiliary examination are shown, and from the figure it can be seen that there are 47 labels, and the prediction accuracy of most labels fluctuates around the average value. Overall, the macro-averaged accuracy of the optimal model trained by the invention is 84%.

[0200] Figure 8 The confusion matrix diagram drawn for the prediction structure of the auxiliary examination project is a two-dimensional 47x47 table, representing the classification prediction results of the 47 different labels of the auxiliary examination. Each element Cij in the matrix represents the number of samples that actually belong to class i but are predicted to be class j. When i=j, it represents the case where the actual label and the predicted label are completely matched, i.e. the true positive. It can be seen that the diagonal elements of the table are more prominent in color, i.e. the number of true positives in the prediction is more prominent, which is a good performance of the prediction result. And based on the confusion matrix, the recall rate, F value, AUC value and other indicators can be calculated to evaluate the classification performance of the model.

[0201] In addition, in order to further illustrate the effectiveness of the method, the same data set and multiple models commonly used in the field of machine learning classification prediction at present (i.e. K-nearest neighbor algorithm KNN, support vector machine SVM, stochastic gradient descent SGD, multilayer perceptron MLP) are used for detailed comparative analysis. The following table shows the detailed comparative evaluation numerical data, Figure 9For comparison of the column chart (where RF is the present application), it can be seen that the auxiliary examination item prediction model constructed by the present application has the highest macro average accuracy, F value (F-Measure) and the optimal Area Under Curve (AUC) value, and the regression rate ranks second, compared with several other models. Therefore, overall, the implementation effect of the present application is relatively optimal.

[0202] Model Macro-averaged accuracy Regression rate F value AUC value The present invention 0.836 0.810 0.857 0.910 K-nearest neighbors algorithm 0.784 0.835 0.721 0.825 Support vector machine 0.711 0.771 0.733 0.785 Stochastic gradient descent 0.675 0.523 0.688 0.674

[0203] Those skilled in the art can easily understand that the above description is only a preferred embodiment of the present application, and is not intended to limit the present application, and any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for predicting patient auxiliary examination items based on supervised learning, characterized in that, Includes the following steps: (1) Obtain the electronic medical records of hospitalized patients and store them and their corresponding hospitalization numbers in an Excel spreadsheet as the source data of hospitalized patients; (2) Preprocess the source data of hospitalized patients obtained in step (1) to obtain preprocessed source data; (3) Input the preprocessed source data from step (2) into the pre-trained auxiliary examination item prediction model to obtain preliminary prediction results of the auxiliary examination items for hospitalized patients, and use the pre-established auxiliary examination coding table to de-encode the preliminary prediction results to obtain the final prediction results of the auxiliary examination items for hospitalized patients; the auxiliary examination item prediction model is trained and obtained through the following steps: (3-1) Obtain the original dataset consisting of electronic medical record data of multiple hospitalized patients; preprocess the original dataset and perform data augmentation on the preprocessed dataset to obtain the data-augmented dataset; (3-2) Perform feature extraction and matrix transformation on the augmented dataset obtained in step (3-1) to obtain the matrix-transformed dataset; (3-3) Divide the matrix-based dataset obtained in step (3-2) into a training set, a validation set, and a test set, and further separate the training set feature data and the training set target variable from the training set; (3-4) Initialize the parameters of the individual decision tree to obtain the initialized individual decision tree; (3-5) Bootstrap random sampling is performed on the training set feature data and training set target variables obtained in step (3-3) to construct multiple individual decision trees in parallel; (3-6) For each individual decision tree constructed in step (3-5), firstly select the preliminary diagnostic feature with the most decision influence from its current node, then randomly select one feature from all other features of the current node, calculate the Gini index corresponding to the two selected features, and select the feature with the smallest Gini index as the best splitting feature of the current node of the individual decision tree. (3-7) For each individual decision tree constructed in step (3-5), based on the best splitting feature of the current node of the individual decision tree selected in step (3-6), generate a list of all candidate splitting points corresponding to it, traverse each candidate splitting point in the list, calculate its corresponding Gini index, and select the candidate splitting point with the smallest Gini index as the best splitting point of the current node of the individual decision tree. (3-8) For each individual decision tree constructed in step (3-5), according to the best splitting feature of the current node of the individual decision tree obtained in step (3-6) and the best splitting point of the current node of the individual decision tree obtained in step (3-7), the sample of the current node of the individual decision tree is divided into left node and right node. (3-9) For each individual decision tree constructed in step (3-5), recursively repeat steps (3-6) to (3-8) for that individual decision tree until the preset termination condition is met, thereby obtaining the constructed individual decision tree; (3-10) Integrate all the individual decision trees constructed in step (3-9) into a random forest, which serves as a pre-trained random forest classification prediction model; (3-11) Use the test set obtained in step (3-3) to verify the random forest classification prediction model initially trained in step (3-10) to obtain the performance analysis results of the model. Based on the performance analysis results, continuously adjust the parameters of the random forest classification prediction model and perform cross-validation to obtain the final trained random forest classification prediction model.

2. The method for predicting patient auxiliary examination items based on supervised learning according to claim 1, characterized in that, Step (2) specifically involves first cleaning and deduplicating the source data of hospitalized patients to obtain pre-processed source data. Then, the source data after the initial processing is subjected to keyword segmentation and data anonymization to obtain the source data after secondary processing. Subsequently, the required feature data is extracted from the source data after secondary processing. The feature data is then encoded using the encoding method corresponding to the feature data. The final source data obtained is the preprocessed source data. The encoding method for feature term data is as follows: For the feature data of gender characteristics, one-hot encoding is used to convert them into binary feature encoding results; For the feature data of age characteristics, it is necessary to classify the hospitalized patients according to their distribution in different age groups, and then perform one-hot encoding on each age group to obtain the feature encoding results. For feature data that includes characteristics of admission reasons and preliminary diagnosis characteristics, which are multi-labeled, firstly, all labels of the feature data are extracted to obtain a label list. Then, the labels in the label list are traversed one by one, and the corresponding code of each label is obtained from the pre-established feature coding table. Finally, the corresponding codes of all labels are summarized to obtain the feature coding result of the feature data.

3. The method for predicting patient auxiliary examination items based on supervised learning according to claim 2, characterized in that, The feature encoding table is established according to the following steps: First, extract all labels of each feature item data from a large amount of sample data and summarize them to obtain the corresponding label list. Then, the label list is deduplicated and normalized to obtain a standardized label list. Finally, the standardized label list is customized to obtain the feature encoding table corresponding to the feature item data. The auxiliary inspection coding table is established according to the following steps: First, all different labels for each auxiliary inspection data are extracted from a large amount of sample data and summarized to obtain a corresponding auxiliary inspection label list. This auxiliary inspection label list summarizes all different auxiliary inspection item names. Then, the auxiliary inspection label list is deduplicated and normalized to obtain a standardized auxiliary inspection label list. Finally, each label in the standardized auxiliary inspection label list is assigned a custom code that starts with the letter "E" followed by three digits to obtain the auxiliary inspection coding table corresponding to the auxiliary inspection data.

4. The method for predicting patient auxiliary examination items based on supervised learning according to claim 3, characterized in that, The auxiliary inspection item prediction model includes a data processing module and a random forest classification prediction model; The data processing module takes inpatient source data as input and outputs preprocessed source data, comprising a three-layer structure: The first layer takes the source data of hospitalized patients as input, performs data cleaning and deduplication on the source data, and outputs the source data after preliminary processing. The second layer takes the source data after the initial processing from the first layer as input, performs content segmentation and data anonymization on the source data, and outputs the source data after secondary processing. The input to the third layer is the source data after secondary processing of the output of the second layer. It encodes the feature data of the source data and outputs the preprocessed source data.

5. The method for predicting patient auxiliary examination items based on supervised learning according to claim 4, characterized in that, The random forest classification prediction model consists of multiple individual decision trees. The input of the random forest classification prediction model is the preprocessed source data output by the data processing module, and the output is the prediction results of the auxiliary inspection items. The random forest classification prediction model consists of the following three layers: The input of the first layer is the preprocessed source data output by the data processing module. It performs feature extraction, dataset partitioning, and data separation on the source data, and outputs training set feature data, training set target variables, test set, and validation set datasets. The input to the second layer is the training set feature data and training set target variable output from the first layer. Based on the CART classification and regression tree method, multiple individual decision trees are constructed and output according to the training set feature data and training set target variable. Each individual decision tree includes its own split structure and prediction results. The input to the third layer is the constructed individual decision trees output from the second layer. These trees are integrated and their prediction results are combined, and the output is the prediction results for the auxiliary inspection items.

6. The method for predicting patient auxiliary examination items based on supervised learning according to claim 5, characterized in that, The first layer of the data processing module sorts the source data of hospitalized patients according to their hospitalization number to form an Excel list. Then, it uses the dropna() method of the pandas library in Python to delete missing data and blank rows in the Excel list. Subsequently, it uses the drop_duplicates() method to remove duplicates from the Excel list. Finally, it saves the Excel table after deduplication as the source data after preliminary processing. The second layer of the data processing module first uses the replace() method of Python's pandas library to remove all spaces and newline characters from the source data after initial processing. Then, it uses the find() method to obtain the index of the target keyword and uses the obtained index to segment the large amount of natural language in the source data into multiple data item lists. Next, all data item lists are stored in a new Excel spreadsheet to obtain the segmented source data. Finally, the name-sensitive data column is removed from the segmented source data to obtain the anonymized dataset, which is the dataset after secondary processing. The third layer of the data processing module first extracts all feature data items from the source data after secondary processing. Then, it encodes the feature data items using different encoding methods for different categories of feature data items to obtain the corresponding feature encoding results. Finally, it writes the feature encoding results back to the corresponding columns in the source data to obtain the preprocessed source data.

7. The method for predicting patient auxiliary examination items based on supervised learning according to claim 6, characterized in that, The first layer of the random forest classification prediction model first extracts a feature dataset composed of multiple feature data from the preprocessed source data. Then, the feature dataset is divided into training, validation, and test sets according to a set ratio. Finally, the feature data and target variable in the training set are separated to obtain the training set feature data and training set target variable. For the three multi-label data items—admission reason data, preliminary diagnosis data, and auxiliary examination data—additional matrix processing is required before proceeding to the next dataset partitioning step. Specifically: First, for multi-label data of different categories, query the corresponding feature encoding table to obtain the encoding list corresponding to the multi-label data of each category; Then, for each category of multi-label data, a two-dimensional matrix is ​​created. The number of rows in the matrix is ​​equal to the total number of multi-label data for that category, with each row corresponding to one multi-label data. The number of columns in the matrix is ​​equal to the number of codes in the corresponding code list, with each column corresponding to one code. Finally, for the multi-label data of each category, the corresponding two-dimensional matrix is ​​filled by: traversing the codes it contains, obtaining the sequence number of the code in the corresponding code list, and then setting the elements in the row of the multi-label data and the column of the code sequence number in the corresponding two-dimensional matrix to 1, and setting the other elements in the two-dimensional matrix to 0. The second layer of the random forest classification prediction model first initializes the key parameters of the individual decision trees. Then, it uses bootstrap sampling to draw samples with replacement from the training set data to construct multiple individual decision trees. Subsequently, during the splitting process at each node of each individual decision tree, a subset of features is randomly selected from all features to calculate the Gini index, and the feature that minimizes the Gini index is selected for splitting to determine the optimal splitting feature. Next, for the obtained optimal splitting feature, a list of all corresponding candidate splitting points is generated. Each candidate splitting point in the list is traversed, its corresponding Gini index is calculated, and the candidate splitting point with the smallest Gini index is selected as the optimal splitting point for the current node. Subsequently, based on the selected best splitting features and best splitting points, the samples of the current node are divided into multiple child nodes, and the aforementioned feature selection and splitting process is recursively performed on each child node until the stopping condition is met; when the splitting stopping condition of an individual decision tree is met, the current node becomes a leaf node, and the prediction results of the samples in that node are stored in the form of a binary two-dimensional matrix as the prediction result, and the construction of the individual decision tree ends. The third layer of the random forest classification prediction model first integrates all the constructed individual decision trees into a random forest. Then, it obtains the code list corresponding to the auxiliary inspection data according to the auxiliary inspection coding table. Subsequently, for each code in the coding list, it counts the prediction results of the code in all individual decision trees of the random forest and selects the prediction result with the most occurrences as the final prediction result of the label corresponding to the code. Finally, it summarizes the prediction results of all codes and uses the codes that are predicted to exist as the prediction results of the auxiliary inspection items.

8. The method for predicting patient auxiliary examination items based on supervised learning according to claim 7, characterized in that, Step (3-2) specifically involves first extracting gender data, age data, reason for admission data, preliminary diagnosis data, and auxiliary examination data feature items from the data augmentation dataset obtained in step (3-1). Then, for each multi-label data, a corresponding two-dimensional matrix is ​​created to obtain the matrixed dataset. Step (3-2) further includes: For each category of multi-label data, create a two-dimensional matrix, that is, create a two-dimensional matrix for each of the three categories of multi-label data: admission reason data, preliminary diagnosis data, and auxiliary examination data. The number of rows in the two-dimensional matrix is ​​equal to the total number of multi-label data in that category, with each row corresponding to one multi-label data. The number of columns in the matrix is ​​equal to the number of codes in the corresponding code list, with each column corresponding to one code. Step (3-3) is as follows: First, the dataset is randomly sampled in a ratio of 7:2:1 and divided into a training set, a validation set, and a test set. Then, in the training set, the matrixed preliminary diagnosis data and the data on the reasons for admission are extracted to form the feature data of the training set, and the matrixed auxiliary examination data are extracted to form the target variables of the training set. Step (3-9) specifically involves repeating steps (3-6) to (3-8) for each individual decision tree, causing the individual decision tree to split continuously until the preset maximum depth is reached or the number of samples in the current node is less than the minimum number of sample splits. At this point, the current node becomes a leaf node, and the corresponding individual decision tree is completed. Step (3-11) specifically involves first calculating the feature importance score and drawing a confusion matrix to obtain the performance index of the pre-trained random forest classification prediction model on the validation set. Then, the model parameters in step (3-4) are continuously adjusted based on the performance index, and the model training process from (3-5) to (3-10) is repeated for cross-validation to optimize the model and obtain the final trained random forest classification prediction model.

9. A system for predicting patient auxiliary examination items based on supervised learning, characterized in that, include: The first module is used to obtain the electronic medical records of hospitalized patients and store them and their corresponding hospitalization numbers in an Excel spreadsheet as the source data of hospitalized patients. The second module is used to preprocess the source data of hospitalized patients obtained from the first module to obtain preprocessed source data. The third module is used to input the preprocessed source data from the second module into a pre-trained auxiliary examination item prediction model to obtain preliminary prediction results for the auxiliary examination items of hospitalized patients. Then, it uses a pre-established auxiliary examination coding table to de-encode these preliminary prediction results to obtain the final prediction results for the auxiliary examination items of hospitalized patients. The auxiliary examination item prediction model is trained through the following steps: (3-1) Obtain the original dataset consisting of electronic medical record data of multiple hospitalized patients; preprocess the original dataset and perform data augmentation on the preprocessed dataset to obtain the data-augmented dataset; (3-2) Perform feature extraction and matrix transformation on the augmented dataset obtained in step (3-1) to obtain the matrix-transformed dataset; (3-3) Divide the matrix-based dataset obtained in step (3-2) into a training set, a validation set, and a test set, and further separate the training set feature data and the training set target variable from the training set; (3-4) Initialize the parameters of the individual decision tree to obtain the initialized individual decision tree; (3-5) Bootstrap random sampling is performed on the training set feature data and training set target variables obtained in step (3-3) to construct multiple individual decision trees in parallel; (3-6) For each individual decision tree constructed in step (3-5), firstly select the preliminary diagnostic feature with the most decision influence from its current node, then randomly select one feature from all other features of the current node, calculate the Gini index corresponding to the two selected features, and select the feature with the smallest Gini index as the best splitting feature of the current node of the individual decision tree. (3-7) For each individual decision tree constructed in step (3-5), based on the best splitting feature of the current node of the individual decision tree selected in step (3-6), generate a list of all candidate splitting points corresponding to it, traverse each candidate splitting point in the list, calculate its corresponding Gini index, and select the candidate splitting point with the smallest Gini index as the best splitting point of the current node of the individual decision tree. (3-8) For each individual decision tree constructed in step (3-5), according to the best splitting feature of the current node of the individual decision tree obtained in step (3-6) and the best splitting point of the current node of the individual decision tree obtained in step (3-7), the sample of the current node of the individual decision tree is divided into left node and right node. (3-9) For each individual decision tree constructed in step (3-5), recursively repeat steps (3-6) to (3-8) for that individual decision tree until the preset termination condition is met, thereby obtaining the constructed individual decision tree; (3-10) Integrate all the individual decision trees constructed in step (3-9) into a random forest, which serves as a pre-trained random forest classification prediction model; (3-11) Use the test set obtained in step (3-3) to verify the random forest classification prediction model initially trained in step (3-10) to obtain the performance analysis results of the model. Based on the performance analysis results, continuously adjust the parameters of the random forest classification prediction model and perform cross-validation to obtain the final trained random forest classification prediction model.

Citation Information

Patent Citations

  • Methylated biomarkers related to antipsychotic drug curative effect prediction

    CN113355406A

  • Diabetes ICU patient death risk prediction method based on artificial intelligence

    CN114664449A