Model training method and related device

By extracting target features from the data through multiple feature selection methods and constructing training samples to train the model, the problem of insufficient model performance caused by imbalanced feature selection is solved, and the overall performance and stability of the model are improved.

CN120632469BActive Publication Date: 2025-11-28SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511123790.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-11-28
Estimated Expiration
2045-08-12

AI Technical Summary

Technical Problem

The current technology uses a single feature selection method, which results in the model performing well in some dimensions but poorly in others, leading to poor overall performance of the trained model.

Method used

Multiple feature selection methods are used to extract features from the data. The target features are determined by the features extracted by different feature selection methods, and the intersection of features with good performance in different dimensions is used to construct training samples to train the model.

Benefits of technology

It significantly improves the overall performance of the model, solves the problem of insufficient model performance caused by imbalanced feature selection, and enhances the stability and generalization ability of the model on different datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632469B_ABST
    Figure CN120632469B_ABST
Patent Text Reader

Abstract

The application discloses a model training method and related equipment, and belongs to the technical field of model training. The method comprises the following steps: acquiring a plurality of first data, and determining a plurality of features selected by different feature selection modes in the features of each first data to construct a first feature set corresponding to the feature selection mode; determining target features related to a prediction target according to the features in the first feature set corresponding to each feature selection mode; extracting features matched with the target features in each first data to construct a training sample corresponding to each first data, and training a preset model according to each training sample to obtain a prediction model, wherein the prediction model is used for predicting to-be-predicted data to obtain a probability parameter corresponding to the prediction target. In the application, the performance of the trained model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of model training, and particularly relates to a model training method and related equipment. BACKGROUND

[0002] With the development of large model technology, more and more fields can construct corresponding models.

[0003] In the example technology, by selecting features related to a prediction target in data, training samples are constructed based on the features, and the model is trained by the training samples.

[0004] However, the selection of the above features is relatively single, so that the selected features have better performance in the dimension focused on by the feature selection method, but have poor performance in other dimensions, resulting in poor performance of the trained model. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide a model training method and related equipment to solve the problem of poor performance of the model.

[0006] In a first aspect, the embodiments of the present application provide a model training method, comprising:

[0007] Obtain a plurality of first data, and determine a plurality of features selected by different feature selection methods in the features of each of the first data to construct a first feature set corresponding to the feature selection method;

[0008] Determine target features related to a prediction target according to the features in the first feature set corresponding to each of the feature selection methods;

[0009] Extract features matching the target features in each of the first data to construct a training sample corresponding to each of the first data, and train a preset model according to each of the training samples to obtain a prediction model, wherein the prediction model is used to predict a to-be-predicted data to obtain a probability parameter corresponding to the prediction target.

[0010] In an embodiment, the target features related to the prediction target are determined according to the features in the first feature set corresponding to each of the feature selection methods, comprising:

[0011] Obtain second data in each database, wherein the second data contains at least one feature in the first feature set;

[0012] Determine a first prediction contribution value of the features in each data set to the prediction target, wherein each data set is constructed by each second data corresponding to at least one database;

[0013] According to the first prediction contribution value, a plurality of first features are determined in each feature of the data set, to construct a second feature set corresponding to the data set, wherein the first feature corresponds to a first prediction contribution value greater than a first preset threshold value;

[0014] An intersection between the second feature sets corresponding to each of the data sets is determined, and a second feature in the intersection is determined as a target feature related to the prediction target.

[0015] In an embodiment, the determination of the first prediction contribution value of the feature in each data set to the prediction target comprises:

[0016] A type corresponding to the data set is determined, wherein the type is used to indicate that the data set is a training set or a test set;

[0017] According to the type corresponding to the data set, the first prediction contribution value of the feature in the data set to the prediction target is determined.

[0018] In an embodiment, the determination of the target feature related to the prediction target from the features in the first feature set corresponding to each of the feature selection manners comprises:

[0019] The second prediction contribution value of the feature in the first feature set corresponding to each of the feature selection manners to the prediction target is determined.

[0020] According to the second prediction contribution value, a target feature is determined from the features in the first feature set corresponding to each of the feature selection manners, wherein the second prediction contribution value of the target feature is greater than a second preset threshold value.

[0021] In an embodiment, the acquisition of the plurality of first data comprises:

[0022] A plurality of candidate data are acquired, and a sample type to which each of the candidate data belongs is determined, wherein the sample type comprises a positive sample and a negative sample;

[0023] According to the sample type of the candidate data, a plurality of first data are determined from each of the candidate data, wherein a half number of first data in each of the first data is a positive sample.

[0024] In an embodiment, the acquisition of the plurality of candidate data comprises:

[0025] A plurality of initial data are acquired, and a feature missing rate corresponding to each of the initial data is determined according to a feature in each of the initial data;

[0026] According to the feature missing rate, intermediate data is determined in each of the initial data, and the feature missing rate of the intermediate data is less than a preset missing rate;

[0027] The intermediate data is filled in features to obtain candidate data.

[0028] In a second aspect, an embodiment of the present application provides a model training device, comprising:

[0029] An acquisition module is configured to acquire a plurality of first data, and determine a plurality of features selected by different feature selection manners in features of each of the first data to construct a first feature set corresponding to the feature selection manner.

[0030] A determination module is configured to determine target features related to a prediction target according to features in the first feature set corresponding to each of the feature selection manners.

[0031] An extraction module is configured to extract features matched with the target features in each of the first data to construct a training sample corresponding to each of the first data, and train a preset model according to each of the training samples to obtain a prediction model, wherein the prediction model is configured to predict a to-be-predicted data to obtain a probability parameter corresponding to the prediction target.

[0032] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a processor and a memory, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement steps of the method in the first aspect.

[0033] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores programs or instructions, and the programs or instructions are executed by a processor to implement steps of the method in the first aspect.

[0034] In a fifth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium, and the program product is executed by at least one processor to implement the method in the first aspect.

[0035] In the embodiments of the present application, a plurality of first data are acquired, different feature selection manners are used to determine a plurality of features selected by the feature selection manners in the features of each first data to construct a feature set corresponding to the feature selection manner, and a target feature related to a prediction target is determined based on the features in the various feature selection manners, and a training sample corresponding to each first data is constructed by extracting a feature matching the target feature in each first data, and a prediction model is trained by each training sample to perform prediction. In the embodiments, the features in the data are extracted by different feature selection manners, and the intersection between the features extracted by different feature selection manners is acquired, and the performance of the target feature related to the prediction target in the dimensions focused on by different feature selection manners is determined to be good, so that the training sample constructed based on the target feature is trained. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is a flowchart of a model training method according to an example embodiment;

[0037] Figure 2 is a flowchart of a model training method according to an example embodiment;

[0038] Figure 3 is a flowchart of a model training method according to an example embodiment;

[0039] Figure 4 is a flowchart of a model training method according to an example embodiment;

[0040] Figure 5 is a flowchart of a model training method according to an example embodiment;

[0041] Figure 6 is a structural block diagram of a model training device according to an example embodiment;

[0042] Figure 7 is a structural block diagram of an electronic device according to an example embodiment. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described clearly in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0044] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a class and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents the front and back.

[0045] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards, and provide corresponding operation portal for user to choose authorization or refusal.

[0046] With the development of large model technology, more and more fields can build corresponding models.

[0047] In an exemplary technology, by selecting features related to the prediction target in the data, training samples are constructed based on the features, and the model is trained by the training samples.

[0048] However, the selection method of the above features is relatively single, so that the selected features have good performance in the dimension focused on by the feature selection method, but have poor performance in other dimensions, resulting in poor performance of the trained model.

[0049] To solve the problem of poor performance of the model, the present inventors think that different feature selection methods are used to extract features from the data, and the target features related to the prediction target are determined by the features extracted by different feature selection methods, and the performance of the target features in the dimensions focused on by different feature selection methods is good, so that the model trained based on the target features has excellent performance.

[0050] The model training method and related device provided by the embodiments of the present application will be described in detail below through specific embodiments and application scenarios.

[0051] The model training method provided by the embodiments of the present application can be applied to the application scenario of vehicle driving.

[0052] The model training method provided by the embodiments of the present application will be described in detail below.

[0053] Reference Figure 1 ,Figure 1 One of the flowcharts of the model training method provided in the present application is shown in FIG. 1. As shown in FIG. 1, the model training method comprises the following steps: Figure 1

[0054] In step S101, a plurality of first data are acquired, and a plurality of features selected by different feature selection manners are determined in the features of each first data, so as to construct a first feature set corresponding to the feature selection manner.

[0055] In the present embodiment, the execution subject is a model training device, and for the convenience of description, the device is used to represent the model training device hereinafter. The device can be a terminal device with model training capability, for example, the device is a server or a computer with large computing power.

[0056] The device acquires a plurality of first data. The first data can be desensitized patient clinical data. In addition, each first data can be acquired from different databases, for example, the first data can be acquired from different ICU (Intensive Care Unit) databases.

[0057] The first data can contain the following information:

[0058] Demographic information: age, gender, race and weight;

[0059] Complications: peripheral vascular disease, cerebrovascular disease, dementia, chronic lung disease, etc.

[0060] Laboratory indicators: hemoglobin, white blood cells, creatinine, glucose, etc. 47 inspection indicators;

[0061] Vital signs: heart rate, respiratory rate, systolic blood pressure, diastolic blood pressure, body temperature, etc.

[0062] The device is provided with a target variable, which is the target to be predicted by the trained model. For example, the target variable can be cardiac arrest, i.e. the prediction target is cardiac arrest. Of course, the prediction target can also be other types of diseases, and is not limited to cardiac arrest. The first data is not limited to clinical data, but can also be any other type of data. The specific type of first data is determined based on the field of application of the model to be trained by the device. For example, the device needs to train a model in the financial field, then the first data is financial data, and the device needs to train a model in the medical field, then the first data is clinical data.

[0063] ​When the first data is clinical data, the device obtains the first data from the ICU database through screening criteria. Specifically, the device first performs data screening from the ICU database based on screening conditions, i.e., different ICU database data can be screened. The screening conditions include but are not limited to: the patient's age is greater than 18 years old; there is no congestive heart failure, myocardial infarction or malignant tumor event; the patient has been in the ICU for more than 3 hours; for patients who have been in the ICU multiple times, the first time record is obtained.

[0064] The screened data is desensitized, i.e., the patient's name and other identity identifiers in the data are removed, i.e., the first data is obtained.

[0065] After obtaining the first data, the device determines a plurality of features selected by different feature selection methods in the features of each first data. Different feature selection methods include a partial least squares regression method, a random forest feature selection method, and a breadth-first search feature selection method. The following describes the determination of features by different feature selection methods.

[0066] 1. Partial least squares regression feature selection method:

[0067] The input data (first data) is standardized to eliminate the influence of different feature dimensions.

[0068] Construct a partial least squares regression model: use the partial least squares regression method to establish a classification model between the features in the input data and the target variable (prediction target). The partial least squares regression extracts the potential components in the first data as features by maximizing the covariance between the input features and the target variable.

[0069] Feature importance evaluation: determine the weight of each feature in the first data through the least squares regression model, so as to evaluate the importance of the feature to the target variable through the weight, and retain the features with higher weights as the preliminary candidate features.

[0070] Screening feature subset: set a threshold to screen the features with the strongest correlation with the target variable, and screen the features with weights greater than the threshold as the features selected by the feature selection method.

[0071] 2. Random forest feature selection method:

[0072] Generate shadow features: randomly shuffle the features in the first data to generate a set of "shadow features". These shadow features are used to provide a reference for random noise.

[0073] Train a random forest model: combine the original features in the first data with the shadow features, and use the random forest model to train and evaluate the importance of the features.

[0074] Comparing feature importance: Compare the importance score of each original feature with the shadow feature. If a feature's importance is significantly higher than the shadow feature, mark it as "confirmed relevant feature." If a feature's importance is close to the shadow feature, mark it as "uncertain feature." If a feature's importance is lower than the shadow feature, mark it as "irrelevant feature."

[0075] Iterative optimization: Repeat the above process multiple times, gradually removing irrelevant features, until all features are classified as "confirmed relevant features" or "irrelevant features."

[0076] Output feature subset: Output all "confirmed relevant features," which are the features selected by the random forest feature selection method.

[0077] 3. Breadth-first search feature selection method

[0078] Objective: Evaluate the contribution of each candidate clinical variable to the model's predictive performance. Candidate clinical variables are features in the first data set, such as white blood cells, red blood cells, lymphocytes, anion gap, heart rate, etc.

[0079] Method: Combine the current optimal clinical variable set with each candidate clinical variable to form a temporary variable set.

[0080] Use a logistic regression model to train the model based on the temporary variable set and predict the probability of the target variable.

[0081] Calculate the performance indicators of the model, including: ROC curve and AUC value, to measure the overall prediction ability; sensitivity and specificity, to evaluate the model's performance on different categories. Save the performance indicators corresponding to each candidate clinical variable to the result dictionary for subsequent comparison.

[0082] Update the optimal clinical variable set:

[0083] Objective: Gradually build the optimal clinical variable set based on the evaluation results.

[0084] Method: In the current round, select the clinical variable with the highest performance indicator (such as AUC value).

[0085] If the addition of this variable significantly improves the model's performance (such as higher AUC value), include it in the optimal clinical variable set. Remove the selected variable from the candidate variable list to avoid repeated evaluation. If no variable can further improve performance, stop searching.

[0086] Correlation as a tie-breaker:

[0087] Objective: When multiple variables perform similarly, break the tie through correlation analysis.

[0088] Method: calculate the correlation between each candidate clinical variable and the target variable. Rank the candidate variables by correlation from high to low. Prioritize the variables with the highest correlation to the target variable, and these retained variables are the features selected by the breadth-first search feature selection method.

[0089] Each feature selection method selects multiple features from the first data, and the features selected by the feature selection method constitute the feature set corresponding to the feature selection method, that is, each feature selection method has a corresponding feature set. The feature set is defined as the first feature set.

[0090] In this embodiment, through the above three feature selection methods, high-dimensional data can be efficiently processed from multiple dimensions. Among them, the partial least squares regression feature selection method extracts the most explanatory features by maximizing the covariance between the features and the target variable, and is particularly suitable for high-dimensional data and small sample scenarios; the feature selection method of random forest comprehensively identifies relevant features based on random forest, avoiding the information omission problem caused by only selecting the best features; the feature selection method of breadth-first search gradually iterates to find the global optimal feature subset by simulating the process of natural selection and genetic variation, ensuring the efficiency and stability of feature selection. This comprehensive use of multiple feature selection methods helps to overcome the shortcomings of single feature selection techniques in comprehensiveness and accuracy, significantly improving the quality of feature selection.

[0091] Step S102, according to the features in the first feature set corresponding to various feature selection methods, determine the target features related to the prediction target.

[0092] After obtaining the first feature set corresponding to each feature selection method, based on the features in each first feature set, the target features related to the prediction target can be determined.

[0093] For example, determine the intersection between each first feature set, which is defined as the first intersection, and the device determines the target features related to the prediction target based on the features in the first intersection. For example, all features in the first intersection can be used as target features. For example, the prediction target is cardiac arrest, and the target features related to cardiac arrest are GCS (Glasgow Coma Scale, Glasgow Coma Scale) score, creatinine, and white blood cells.

[0094] Step S103, extract features matching the target features in each first data to construct a training sample corresponding to each first data, and train the preset model according to each training sample to obtain a prediction model, wherein the prediction model is used to predict the prediction target corresponding to the probability parameter.

[0095] After obtaining the target features, features matching the target features are extracted from each first data to construct a training sample corresponding to the first data. For example, the target features are GCS score, creatinine and white blood cells, and the GCS score, creatinine and white blood cells are extracted from the first data, and the three target features are labeled with labels, i.e., the training sample corresponding to the first data is obtained, and the labels are, for example, cardiac arrest or non-cardiac arrest.

[0096] After obtaining each training sample in the above manner, the preset model is trained based on each training sample, and a prediction model is obtained. The prediction model is used to predict the prediction target to obtain a probability parameter corresponding to the prediction target. For example, the prediction target is cardiac arrest, and the prediction model outputs the probability of cardiac arrest of the patient to which the detection data belongs. The prediction model can be deployed on a device or any other hardware device to predict the prediction target. The prediction model can be applied to disease prediction, personalized treatment and other fields. An exemplary training process of the prediction model is as follows:

[0097] 1. Data preparation and division:

[0098] Input features: The selected key features (such as GCS score, creatinine and white blood cells) are used as input variables of the model.

[0099] Target variable: According to the research target, the corresponding label (whether the patient has cardiac arrest) is selected as the target variable.

[0100] 2. Random forest model construction

[0101] Model selection: Random forest is used as the basic model because it has strong robustness and the ability to capture nonlinear relationships.

[0102] Hyperparameter optimization: Bayesian optimization algorithm is used to automatically optimize the hyperparameters of the random forest. The optimized hyperparameters include but are not limited to the number of decision trees, the maximum depth of a single decision tree, the minimum number of samples required for node splitting, the minimum number of samples required for leaf nodes, the maximum number of features considered when splitting each tree, and the target of Bayesian optimization is to minimize the cross-validation loss function (such as AUC).

[0103] Model training and 5-fold cross-validation: The training set is divided into 5 subsets, and each time 4 subsets are used as training data and the remaining 1 subset is used as validation data.

[0104] In each round of validation, the performance indicators of the model are recorded, such as AUC, accuracy, recall rate, etc. The average value of the 5 validation results is taken as the performance evaluation of the model.

[0105] Model training:

[0106] Using the optimized hyperparameters, retrain the random forest model on the entire training set.

[0107] Model performance evaluation:

[0108] Test set evaluation: Evaluate the model's generalization performance using an independent test set, and calculate the following metrics:

[0109] AUC (Area Under Curve): Measures the model's ability to distinguish between positive and negative samples.

[0110] Accuracy: The proportion of correctly classified samples.

[0111] Recall: The proportion of actual positive samples that are correctly predicted as positive.

[0112] Evaluate the prediction model constructed above, and the steps of the evaluation can be implemented through the following sub-steps:

[0113] 1.1. Use the training samples extracted from the MIMIC database (an ICU database) as the internal training set, and the training samples extracted from the eICU (another ICU database) database as the external test set, to construct the prediction model;

[0114] 1.2. Calculate the AUC value of the model to evaluate its prediction performance:

[0115] The internal test AUC value is 0.697 (95% confidence interval: 0.675-0.719);

[0116] The external test AUC value is 0.756 (95% confidence interval: 0.745-0.767), indicating that the external test performance is better than the internal test.

[0117] 2.1. Use the eICU database as the internal training set and the MIMIC database as the external test set to construct the prediction model again and evaluate the performance:

[0118] The internal test AUC value is 0.768 (95% confidence interval: 0.756-0.780);

[0119] The external test AUC value is 0.661 (95% confidence interval: 0.656-0.686), indicating that the external test performance is lower than the internal test.

[0120] In this embodiment, an efficient solution is proposed to address the feature redundancy and overfitting problems commonly encountered in high-dimensional data and small sample scenarios, which helps to improve the practical application effect of feature selection. By using the partial least squares regression feature selection method to reduce the data dimension and retain key information, combining the random forest feature selection method to fully explore potential features, and using the breadth-first search feature selection method to find the global optimal solution, this embodiment significantly reduces feature redundancy while improving the interpretability and practicality of features. In addition, the extracted key features can be widely used in machine learning modeling, disease prediction, personalized treatment, and other fields, especially in complex scenarios such as medical big data. This not only helps to improve the performance and stability of the model, but also provides strong technical support for research in precision medicine and other fields, demonstrating the dual value of this embodiment in theoretical innovation and practical application.

[0121] In this embodiment, a plurality of first data are obtained, and different feature selection methods are used to select a plurality of features from the features of each first data to construct a feature set corresponding to the feature selection method. Based on the features in various feature selection methods, target features related to the prediction target are determined, and features matching the target features are extracted from each first data to construct training samples corresponding to the first data. Then, a prediction model is trained based on each training sample to perform prediction. In this embodiment, different feature selection methods are used to extract features from the data, and the intersection of the features extracted by different feature selection methods is obtained. The performance of the target features related to the prediction target in the dimensions emphasized by different feature selection methods is good, so that the model trained based on the target features has excellent performance.

[0122] Referring to Figure 2 , Figure 2 is a flowchart of the model training method provided by the present application, based on the embodiment shown in Figure 1 , step S102 includes:

[0123] Step S201, obtaining second data in each database, the second data containing at least one feature in the first feature set.

[0124] In this embodiment, the device obtains second data in each database based on the features in each first feature set, and each second data contains at least one feature in the first feature set.

[0125] For example, the union of each first feature set is the target feature set, and the data containing at least one feature in the target feature set from the database is used as the second data.

[0126] The apparatus can acquire data in multiple databases, for example, acquiring data containing features in the target feature set in database A as second data, and acquiring data containing features in the target feature set in database B as second data.

[0127] In step S202, the first prediction contribution value of the features in each data set to the prediction target is determined, wherein each data set is constructed by the respective second data corresponding to at least one database.

[0128] After obtaining the respective second data, at least one data set is constructed by the respective second data corresponding to at least one database, for example, constructing a data set by the respective second data extracted from database A, constructing another data set by the respective second data extracted from database B, and constructing a data set by the second data extracted from databases A and B.

[0129] After obtaining the respective data set, the contribution value of the features in each data set to the prediction target is determined, that is, the contribution value of the features in each second data in each data set to the prediction target is determined. The contribution value can be calculated by a random forest model or a contribution value calculation formula. The contribution value calculated by the apparatus is defined as the first prediction contribution value.

[0130] In an example, the first prediction contribution value of the features in each second data in each data set is calculated by a random forest model or a contribution value calculation formula.

[0131] In another example, the apparatus determines the type corresponding to the data set, and determines the first prediction contribution value of the features in the data set to the prediction target based on the type corresponding to the data set. The type is used to indicate whether the data set is a training set or a test set. For example, the data set corresponding to database A is taken as a training set, the data set in database B is taken as a test set, the first prediction contribution value of the features in each second data in the data sets corresponding to A and B is calculated; the data set corresponding to database A is taken as a test set, the data set in database B is taken as a training set, the first prediction contribution value of the features in each second data in the data sets corresponding to A and B is calculated; the first prediction contribution value of the features in the second data in the data set corresponding to databases A and B is calculated, and the data set corresponding to databases A and B is a training set. It should be noted that when the data set is a training set, the product of the contribution value of the features in the second data and a larger weight is taken as the first prediction contribution value; when the data set is a test set, the product of the contribution value of the features in the second data and a smaller weight is taken as the first prediction contribution value.

[0132] In step S203, according to the first prediction contribution value, a plurality of first features are determined in the features of each data set to construct a second feature set corresponding to the data set, and the first prediction contribution value corresponding to the first feature is greater than a first preset threshold.

[0133] After obtaining the first prediction contribution value corresponding to the feature in each data set, a plurality of first features are determined in the features of each data set based on the first prediction contribution value, and the first prediction contribution value of the first feature is greater than a first preset threshold. For example, each feature of the data set has a first prediction contribution value, and the first prediction contribution value greater than the first preset threshold is determined in each feature in the data set. The feature corresponding to the first prediction contribution value greater than the first preset threshold is the first feature of the data set. If the number of first prediction contribution values greater than the first preset threshold is greater than a set number, the first prediction contribution values are sorted, and the features corresponding to the set number of first prediction contribution values in the front are obtained as the first features. For example, the set number is 10, and the first features corresponding to the first prediction contribution values in the front 10 are obtained. Each first feature corresponding to each data set constitutes a second feature set.

[0134] In step S204, the intersection between the second feature sets corresponding to each data set is determined, and the second features in the intersection are determined as target features related to the prediction target.

[0135] Each data set corresponds to a second feature set, and the intersection between each second feature set is determined. The intersection is defined as a second intersection. Each feature in the second intersection is a target feature related to the prediction target.

[0136] Reference Figure 3 , Figure 3For the brief flowchart of the screening of the target features in the present embodiment, exemplarily, the device obtains three data sets, each different data set is subjected to feature selection by different feature selection methods to obtain a plurality of first feature sets (not identified), determines the union set between each first feature set of each data set, that is, each data set has a union set, such as the first data set corresponds to union set 1, the second data set corresponds to union set 2, and the third data set corresponds to union set 3. Each union set is input into the RF model (random forest model), so that the random forest model calculates the SHAP of the features in the five data sets based on the previous three data sets. SHAP is a method based on game theory for explaining the contribution of each feature to the prediction result in a machine learning model. Its core idea is to evaluate the importance of each feature by calculating its marginal contribution under all possible feature combinations. SHAP can be regarded as the contribution value of the feature. The five data sets are MIMIC as the test set, MIMIC as the training set, eICU as the test set, eICU as the training set, and the data set of MIMIC + eICU. The features in each data set are calculated and screened to obtain a second feature set, for example, the top ten SHAP features in the data set are constructed as the second feature set of the data set.

[0137] The intersection of each second feature set can obtain a plurality of generalizable features, and each generalizable feature is a target feature.

[0138] In the present embodiment, by introducing the contribution value analysis and the cross-database screening process, the key features with high stability and strong generalization ability can be effectively extracted. Specifically, in MIMIC (for example, as database A), eICU (for example, as database B) and MIMIC + eICU three different databases, features are extracted based on three feature selection methods respectively, and important features ranking at the front in the internal test set and the external test set are screened out through the intersection operation, thereby ensuring the stability and consistency of the features. In addition, by comprehensively analyzing the results of multiple databases, the key features suitable for cross-database are further screened out, which significantly enhances the universality of the features in different data sets. This method helps to solve the problem that the feature selection results of the exemplary technology are unstable and difficult to adapt to cross-dataset application scenarios, provides a reliable guarantee for feature optimization in complex data environment, and improves the robustness and practical application value of the model.

[0139] Referring to Figure 4 , Figure 4 is a third flowchart of the model training method provided by the present application, based on the embodiments shown in Figure 1 or Figure 2 , step S102 comprises:

[0140] Step S401, determine the second prediction contribution value of each feature in the first feature set corresponding to each feature selection mode to the prediction target.

[0141] In this embodiment, the first feature set is combined to obtain a target feature set, and the device calculates the contribution value of each feature in the target feature set as the second prediction contribution value based on the contribution value or the random forest model.

[0142] Step S402, according to the second prediction contribution value, determine the target feature from the features in the first feature set corresponding to each feature selection mode, and the second prediction contribution value of the target feature is greater than the second preset threshold.

[0143] After obtaining the second prediction contribution value of each feature in the target feature set, the device determines the target feature from the features in the first feature set corresponding to each feature selection mode based on the second prediction contribution value, and the second prediction contribution value of the target feature is greater than the second preset threshold. It should be noted that the first preset threshold and the second preset threshold are both set values, and the first preset threshold and the second preset threshold can be any integer value.

[0144] For example, the features in the target feature set are sorted in descending order of the second prediction contribution value, and the features with a second prediction contribution value greater than the preset threshold are taken as the preliminary features. If the number of preliminary features is greater than a set number, the preliminary features in the front are taken as the target features, and the number of target features is the set number.

[0145] In this embodiment, the device determines the second prediction contribution value of each feature in the first feature set corresponding to each feature selection mode to the prediction target, so as to accurately determine the target feature from the features in the first feature set corresponding to each feature selection mode based on the second prediction value.

[0146] Referring to Figure 5 , Figure 5 is a flowchart of the model training method provided by the present application, based on any of the embodiments shown in Figures 1 to 4 Step S101 includes:

[0147] Step S501, obtain a plurality of candidate data, and determine the sample type to which each candidate data belongs, the sample type including positive samples and negative samples.

[0148] In the embodiment, the number of positive samples and negative samples in the database is different. For example, the positive samples are patients with cardiac arrest, and the negative samples are normal people without cardiac arrest. The number of patients with cardiac arrest is much less than that of normal people without cardiac arrest, so the number of negative samples is much more than that of positive samples. In order to improve the generalization ability and prediction performance of the model, the data needs to be down-sampled to make the number of positive and negative samples uniform.

[0149] In an example, the device obtains a plurality of data from a plurality of databases as candidate data, and determines the sample type to which the candidate data belongs based on the information in the candidate data. The sample type includes positive samples and negative samples. The positive samples are patients with disease A, and the negative samples are normal people without disease A.

[0150] In another example, the device obtains a plurality of initial data from the database, determines the feature missing rate of each initial data according to the features in the initial data, and determines intermediate data in each initial data based on the feature missing rate. The feature missing rate of the intermediate data is less than a preset missing rate. The intermediate data is then filled with features, and the candidate data is obtained.

[0151] For example, the feature missing rate in the initial data is first calculated, that is, all features in the initial data are traversed, and the missing rate of each feature is calculated. The missing rate is the proportion of the number of missing values to the total number of samples.

[0152] The features are divided into two categories: low missing rate features (missing rate < 30%): retained and interpolated; high missing rate features (missing rate ≥ 30%): directly removed, because a higher missing rate may result in unreliable interpolation results.

[0153] The device separates low missing rate features: extracts features with a missing rate lower than 30% to form a new feature matrix for subsequent interpolation operations.

[0154] Standardize feature data: Since feature filling is sensitive to the dimension of features, the data needs to be standardized before feature interpolation.

[0155] To this end, the features are standardized to ensure that each feature has the same scale. The standardization formula is:

[0156]

[0157] Where x represents the original value, μ represents the feature mean, and σ represents the feature standard deviation.

[0158] The device applies a missing value interpolation method, first initializes the missing value interpolation parameters, that is, sets the parameters for missing value interpolation, including:

[0159] n_neighbors: the number of neighbors K to select, usually set as an integer between 3 and 10.

[0160] weights: the type of neighbor weights, can choose "uniform" (uniform weight) or "distance" (distance weighting).

[0161] metric: the distance metric method, usually use Euclidean distance ("euclidean").

[0162] Specifically, the device calculates the distance of the neighbor samples, and for each sample containing missing values, the feature distance of the sample with other samples (ignoring the dimension where the missing value is located) is calculated. The distance calculation formula is:

[0163]

[0164] wherein, and respectively represent two samples, represents the number of features, and represent two adjacent samples.

[0165] The device selects K nearest neighbors: according to the calculated distance, find the K nearest neighbor samples most similar to the current sample.

[0166] The device calculates the estimated value of the missing value: for each missing value, calculate the average value of the K neighbor samples in the corresponding feature as the filling value: if "uniform" weight is used, simply take the average; if "distance" weight is used, calculate the average value according to the distance weighting.

[0167] The device fills in the missing values: inserts the calculated filling value into the corresponding missing position in the original data set.

[0168] The device inverse normalizes: after completing the interpolation, if the data has been standardized before, it needs to be inverse normalized back to the original scale. The inverse normalization formula is: .

[0169] Step S502, according to the sample type of the candidate data, in each candidate data, a plurality of first data are determined, wherein half of the number of first data in each first data is a positive sample.

[0170] After determining the sample type of the candidate data, based on the sample type, a plurality of first data are determined in each candidate data, and in each first data, a half number of first data are positive samples, that is, in each first data, a half number is the data of patients with diseases, and a half number is the data of normal people without diseases.

[0171] In this embodiment, by selecting half of the positive sample data and half of the negative sample data, the positive and negative samples of the training sample used for training are balanced, thereby improving the generalization ability and prediction performance of the training sample.

[0172] Based on the same inventive concept, the present application also provides a model training device. The following will be described in detail in combination with Figure 6 The model training device provided in the embodiments of the present application is described in detail.

[0173] Figure 6 is a structural block diagram of a model training device according to an exemplary embodiment.

[0174] As Figure 6 shown, the model training device 600 can include:

[0175] The acquisition module 610 is configured to acquire a plurality of first data, and determine a plurality of features selected by different feature selection manners in the features of each first data to construct a first feature set corresponding to the feature selection manner.

[0176] The determination module 620 is configured to determine a target feature related to a prediction target according to the features in the first feature set corresponding to each feature selection manner.

[0177] The extraction module 630 is configured to extract features matching the target feature in each first data to construct a training sample corresponding to each first data, and train a preset model according to each training sample to obtain a prediction model, wherein the prediction model is used to predict the to-be-predicted data to obtain a probability parameter corresponding to the prediction target.

[0178] In one embodiment, the model training device 600 further includes:

[0179] The second data are acquired in each database, and the second data contain at least one feature in the first feature set;

[0180] The first prediction contribution value of each feature in each data set to the prediction target is determined, wherein each data set is constructed by each second data corresponding to at least one database;

[0181] According to the first prediction contribution value, a plurality of first features are determined in the features of each data set to construct a second feature set corresponding to the data set, the first feature corresponding to the first prediction contribution value being greater than a first preset threshold value;

[0182] An intersection between the second feature sets corresponding to each data set is determined, and a second feature in the intersection is determined as a target feature related to the prediction target.

[0183] In one of the embodiments, the model training apparatus 600 further comprises:

[0184] A type corresponding to the data set is determined, the type being used to indicate that the data set is a training set or a test set;

[0185] According to the type corresponding to the data set, a first prediction contribution value of a feature in the data set to the prediction target is determined.

[0186] In one of the embodiments, the model training apparatus 600 further comprises:

[0187] A second prediction contribution value of a feature in the first feature set corresponding to each feature selection mode to the prediction target is determined;

[0188] According to the second prediction contribution value, a target feature is determined in the features in the first feature set corresponding to each feature selection mode, the second prediction contribution value of the target feature being greater than a second preset threshold value.

[0189] In one of the embodiments, the model training apparatus 600 further comprises:

[0190] A plurality of candidate data are obtained, and a sample type to which each candidate data belongs is determined, the sample type including a positive sample and a negative sample;

[0191] According to the sample type of the candidate data, a plurality of first data are determined in the candidate data, wherein a half number of first data in each first data is of the positive sample.

[0192] In one of the embodiments, the model training apparatus 600 further comprises:

[0193] A plurality of initial data are obtained, and a feature missing rate corresponding to each initial data is determined according to a feature in each initial data;

[0194] According to the feature missing rate, intermediate data are determined in the initial data, the feature missing rate of the intermediate data being less than a preset missing rate;

[0195] The intermediate data are filled with features to obtain candidate data.

[0196] The model training apparatus provided in the embodiments of the present application canFigures 1-5 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.

[0197] In some embodiments, such as Figure 7 As shown, this application embodiment also provides an electronic device 700, including a processor 701 and a memory 702. The memory 702 stores a program or instructions that can run on the processor 701. When the program or instructions are executed by the processor 701, they implement the various steps of the above-described model training method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0198] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.

[0199] This application also provides a computer-readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described model training method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0200] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as a computer read-only memory, random access memory, magnetic disk, or optical disk.

[0201] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the model training method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0202] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0203] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a part of the prior art that contributes to the present application. The computer software product is stored in a storage medium (such as a ROM / RAM, a magnetic disc, an optical disc), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present application.

[0204] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not restrictive. Those skilled in the art can make many forms without departing from the scope of the present application under the inspiration of the present application, and all of them belong to the protection of the present application.

Claims

1. A model training method, characterized in that, The method comprises the following steps: obtaining a plurality of first data, and determining a plurality of features selected by different feature selection methods from features of each of the first data to construct a first feature set corresponding to the feature selection method, wherein the first data is de-identified patient clinical data, including demographic information, complications, laboratory indicators and vital sign data, and the different feature selection methods include a partial least squares regression method, a random forest feature selection method and a breadth-first search feature selection method; determining target features related to a prediction target according to features in the first feature set corresponding to each of the feature selection methods; extracting features matching the target features from each of the first data to construct a training sample corresponding to each of the first data, and training a preset model according to each of the training samples to obtain a prediction model, wherein the prediction model is used to predict a to-be-predicted data to obtain a probability parameter corresponding to the prediction target; wherein the determining of the target features related to the prediction target according to the features in the first feature set corresponding to each of the feature selection methods comprises: obtaining second data in each database, wherein the second data contains at least one feature in the first feature set; determining a first prediction contribution value of each feature in each data set to the prediction target, wherein each data set is constructed by at least one second data corresponding to each database, and the determining of the first prediction contribution value of each feature in each data set to the prediction target comprises: determining a type corresponding to the data set, wherein the type is used to indicate that the data set is a training set or a test set, and determining the first prediction contribution value of each feature in the data set to the prediction target according to the type corresponding to the data set; determining a plurality of first features from the features in each of the data sets according to the first prediction contribution value to construct a second feature set corresponding to the data set, wherein the first prediction contribution value of the first feature is greater than a first preset threshold; determining an intersection between the second feature sets corresponding to each of the data sets, and determining the second features in the intersection as the target features related to the prediction target.

2. The model training method of claim 1, wherein, The method comprises the following steps: obtaining a plurality of candidate data, and determining a sample type of each of the candidate data, wherein the sample type includes a positive sample and a negative sample; determining a plurality of first data from each of the candidate data according to the sample type of the candidate data, wherein half of the first data in each of the first data is a positive sample.

3. The model training method of claim 2, wherein, The method comprises the following steps: obtaining a plurality of initial data, and determining a feature missing rate corresponding to each of the initial data according to features in each of the initial data; determining intermediate data from each of the initial data according to the feature missing rate, wherein the feature missing rate of the intermediate data is less than a preset missing rate; filling the features of the intermediate data to obtain candidate data.

4. A model training apparatus characterized by comprising: The method comprises the following steps: The acquisition module is configured to acquire a plurality of first data, and determine a plurality of features in features of each of the first data by using different feature selection manners, to construct a first feature set corresponding to the feature selection manner, wherein the first data is de-identified patient clinical data including demographic information, complications, laboratory indicators and vital sign data, and the different feature selection manners include a partial least squares regression manner, a random forest feature selection manner and a breadth-first search feature selection manner. The determination module is configured to determine a target feature related to a prediction target according to the features in the first feature set corresponding to each of the feature selection manners. The extraction module is configured to extract a feature matching the target feature in each of the first data, to construct a training sample corresponding to each of the first data, and train a preset model according to each of the training samples to obtain a prediction model, wherein the prediction model is configured to predict a to-be-predicted data to obtain a probability parameter corresponding to the prediction target. The determination module is configured to determine a target feature related to a prediction target according to the features in the first feature set corresponding to each of the feature selection manners. In each database, second data containing at least one feature in the first feature set is acquired. A first prediction contribution value of a feature in each data set to the prediction target is determined, wherein each data set is constructed by at least one second data corresponding to at least one database, and the determination of the first prediction contribution value of the feature in each data set to the prediction target includes determining a type corresponding to the data set, the type being used to indicate that the data set is a training set or a test set, and determining the first prediction contribution value of the feature in the data set to the prediction target according to the type corresponding to the data set. According to the first prediction contribution value, a plurality of first features are determined in the features of each of the data sets to construct a second feature set corresponding to the data set, and the first prediction contribution value corresponding to the first feature is greater than a first preset threshold. An intersection between the second feature sets corresponding to each of the data sets is determined, and a second feature in the intersection is determined as a target feature related to the prediction target. 5.The model training apparatus of claim 4, wherein, The acquisition module includes the following steps when acquiring a plurality of first data: A plurality of candidate data are acquired, and a sample type of each of the candidate data is determined, wherein the sample type includes a positive sample and a negative sample. According to the sample type of the candidate data, a plurality of first data are determined in each of the candidate data, wherein a sample type of a half number of first data in each of the first data is a positive sample. 6.The model training apparatus of claim 5, wherein, The acquisition of the plurality of candidate data includes the following steps: A plurality of initial data are acquired, and a feature missing rate corresponding to each of the initial data is determined according to features in each of the initial data. According to the feature missing rate, intermediate data are determined in each of the initial data, and the feature missing rate of the intermediate data is less than a preset missing rate. The intermediate data are filled with features to obtain candidate data.

7. An electronic device, comprising: The electronic device includes a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the model training method according to any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program or instructions, the program or instructions being executed by the processor to implement the steps of the model training method according to any one of claims 1-3.

9. A computer program product, characterised in that, The computer program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the model training method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Feature selection method and device, and network equipment identification method and device

    CN118332452A

  • Feature-based data screening and predicting method and system

    CN120296373A