A method, system and medium for constructing a prediction model for adverse drug reactions

Through spectral clustering algorithm and integrated learning strategies, a drug adverse reaction prediction model is constructed, which solves the class imbalance and high-dimensional problems in drug adverse reaction data, improves prediction accuracy and efficiency, and achieves stronger classifier performance.

CN118626851BActive Publication Date: 2024-12-10INST OF BASIC RES & CLINICAL MEDICINE CHINA ACAD OF CHINESE MEDICAL SCI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410761825.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-12-10
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

The existing technology has class imbalance and high-dimensional problems in drug adverse reaction data, which makes it difficult to guarantee the accuracy of the prediction model, and the existing algorithms cannot effectively explore classification rules or lead to the lack of interpretability of the model.

Method used

The spectral clustering algorithm is used to resample the sample set of most classes, and a prediction model of drug adverse reactions is constructed through the Bagging integration strategy and the Boosting integration algorithm. Multiple initial classifiers are combined with the average/voting strategy to form a strong classifier.

Benefits of technology

It significantly improves the accuracy and efficiency of drug adverse reaction prediction, effectively deals with the class imbalance and high-dimensional problems of large sample data, and improves the interpretability and prediction accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626851B_ABST
    Figure CN118626851B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system and medium for constructing a prediction model of adverse drug reactions, which relate to the field of data classification, and include: obtaining large sample data of adverse drug reactions, dividing the large sample data into a minority class sample set with adverse drug reactions and a majority class sample set without adverse drug reactions, applying a spectral clustering algorithm to the majority class sample set to obtain a plurality of majority class sample clusters; randomly sampling all the plurality of majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples and forming majority class sample subsets; based on a Bagging integration strategy, repeatedly applying T times of proportional random sampling to the plurality of majority class sample clusters to construct T majority class sample subsets, and merging them with the minority class sample set respectively to obtain T balanced subsets; and training T base classifiers in parallel through a Boosting integration algorithm, integrating the trained T classifiers to obtain a prediction model for adverse drug reactions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data classification, and in particular to a method, system and medium for constructing a prediction model for adverse drug reactions. Background Art

[0002] In the medical field, the prediction of adverse drug reactions is a key component of the safety evaluation of drugs after they are marketed. It has direct application value and is of great significance for improving medical care, enhancing treatment safety and treatment effects. Accurate adverse drug reaction prediction models can provide valuable diagnosis and treatment assistance for medical workers.

[0003] A major form of adverse drug reaction research is multi-center centralized monitoring, which usually lasts for several years and may include tens of thousands of patients. However, only a very small number of these patients will experience adverse reactions to the target drug. At the same time, the characteristics of such multi-center centralized monitoring of adverse drug reaction data mainly include basic information of patients, past medical history, allergy history, comorbidities, combined medications, medication details, etc. After encoding, the number of variables involved in the data set is hundreds or thousands. Therefore, the real-world large data set of adverse drug reactions has class imbalance and high dimensionality problems. The class imbalance problem refers to the serious imbalance in the proportion of samples of different categories in the data set, in which the number of samples of some categories is far less than that of other categories. The high dimensionality problem refers to the excessive number of variables in the data set, that is, the dimension of the feature space is very high, and for patient data without adverse reactions, the number of variables is much larger than the number of patients.

[0004] In the prior art, for the class imbalance problem of sample data of adverse drug reactions, resampled samples are often used to reduce the degree of imbalance, such as random undersampling, SMOTE oversampling, etc. Random undersampling may ignore most of the majority class patient samples and fail to fully utilize the patient samples in the data set, while SMOTE oversampling may generate a large number of erroneous minority class samples; in addition, for the high-dimensional problem of sample data of adverse drug reactions, commonly used high-dimensional algorithms such as regularization algorithms, dimensionality reduction learning algorithms, etc., cannot fully explore classification rules, or cause the subsequent classification model to lack interpretability, which may make it difficult to ensure the accuracy of the prediction model. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a method for constructing a prediction model for adverse drug reactions. The above prediction model construction method is helpful to obtain an accurate prediction model.

[0006] The method for constructing a prediction model for adverse drug reactions provided by the present invention comprises:

[0007] Obtaining large sample data of adverse drug reactions, which includes features related to patients and drugs, and target features of whether adverse reactions occur. According to the target features, the large sample data is divided into a minority sample set with adverse drug reactions and a majority sample set with no adverse drug reactions. A spectral clustering algorithm is applied to the majority sample set to obtain multiple majority sample clusters.

[0008] Randomly sample all the majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples, and the plurality of randomly sampled majority class samples constitute a majority class sample subset, wherein the number of samples in the majority class sample subset is the same as or balanced with that in the minority class sample set;

[0009] Based on the Bagging ensemble strategy, the proportional random sampling is repeatedly applied T times to multiple majority class sample clusters to construct T majority class sample subsets, which are then merged with the minority class sample set to obtain T balanced subsets.

[0010] For T balanced subsets, T base classifiers are trained in parallel using the Boosting ensemble algorithm, and the trained T classifiers are integrated to obtain a prediction model for adverse drug reactions.

[0011] Preferably, the step of applying a spectral clustering algorithm to the majority class sample set to obtain a plurality of majority class sample clusters includes:

[0012] Calculate the similarity matrix of the majority class sample set based on the kernel function;

[0013] Constructing a corresponding similarity graph based on the similarity matrix;

[0014] A graph cutting operation is performed on the similarity graph to obtain a plurality of majority class sample clusters, and the similarity of samples in the same majority class sample cluster is higher than the similarity of samples in different sample clusters.

[0015] Preferably, the step of randomly undersampling all the plurality of majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples comprises:

[0016] All the majority class sample clusters are divided into clusters and randomly sampled in proportion. The number of samples for random sampling is:

[0017]

[0018] Among them, n(C i ) is the i-th majority class sample cluster C i The number of samples included, n(MA) is the total number of majority class samples, and n(MI) is the total number of minority class samples.

[0019] Preferably, the repeatedly applying proportional random sampling T times to the plurality of majority class sample clusters comprises:

[0020] According to the sample resampling mechanism with replacement, all multiple majority class sample clusters are randomly sampled T times in proportion to obtain T majority class sample subsets.

[0021] Preferably, the Boosting ensemble algorithm includes at least one of the following algorithms: AdaBoost algorithm, Gradient Boosting Decision Tree algorithm, XGBoost algorithm, LightGBM algorithm, CatBoost algorithm.

[0022] Preferably, the T base classifiers after ensemble training include an averaging / voting strategy:

[0023]

[0024] or

[0025] Among them, x i For any data sample, classifier t is the tth classifier.

[0026] The present invention provides a system for building a prediction model for adverse drug reactions, which is used to implement any of the prediction model building methods described above, and the system for building a prediction model for adverse drug reactions comprises:

[0027] The sample partitioning module is used to obtain large sample data of adverse drug reactions. The large sample data includes features related to patients and medicines, as well as target features of whether adverse reactions occur. According to the target features, the large sample data is divided into a minority sample set with adverse drug reactions and a majority sample set with no adverse drug reactions. The spectral clustering algorithm is applied to the majority sample set to obtain multiple majority sample clusters.

[0028] A sampling module is used to randomly sample all the plurality of majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples, wherein the plurality of randomly sampled majority class samples constitute a majority class sample subset, wherein the majority class sample subset has the same number of samples as or is balanced with the minority class sample set;

[0029] A balanced subset construction module is used to repeatedly apply proportional random sampling T times to multiple majority class sample clusters based on the Bagging integration strategy to construct T majority class sample subsets, and merge them with the minority class sample set respectively to obtain T balanced subsets;

[0030] The training model module is used to train T base classifiers in parallel for T balanced subsets through the Boosting ensemble algorithm, integrate the trained T classifiers, and obtain a prediction model for adverse drug reactions.

[0031] The present invention provides a computer-readable storage medium, characterized in that a data processing program is stored on the computer-readable storage medium, and when the data processing program is executed by a processor, the steps of the method for constructing a prediction model for adverse drug reactions as described in any one of the above texts are implemented.

[0032] Compared with the prior art, the method for constructing a prediction model for adverse drug reactions provided by the present invention has the following beneficial effects: a spectral clustering resampling algorithm and a data resampling method are used to achieve reasonable undersampling of the majority class sample sets in large sample data of adverse drug reactions, and two major integration strategies, parallel integration and iterative integration, are combined to respectively deal with the class imbalance problem and the high-dimensionality problem of large sample data of adverse drug reactions, and finally an average / voting strategy is used to combine multiple initial classifiers to obtain a strong classifier that can accurately predict the classification, and the subsequent prediction classification related to adverse drug reactions of the samples to be tested is processed based on the strong classifier, which can significantly improve the prediction efficiency and prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a flow chart of the method for constructing a prediction model for adverse drug reactions in the first embodiment of the present invention.

[0034] Figure 2 It is an application flow chart of the method for constructing a prediction model for adverse drug reactions in the first embodiment of the present invention. DETAILED DESCRIPTION

[0035] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0036] The first embodiment of the present invention provides a method for constructing a prediction model for adverse drug reactions. Figure 1 - Figure 2 The method provided by the first embodiment of the present invention is described in detail. Figure 1 Flowchart of the method for building a predictive model for adverse drug reactions.

[0037] Step S101, obtaining a large sample data of adverse drug reactions, the large sample data including features related to patients and medicines and target features of whether adverse reactions occur, dividing the large sample data into a minority class sample set where adverse drug reactions occur and a majority class sample set where no adverse drug reactions occur according to the target features, applying a spectral clustering algorithm to the majority class sample set to obtain a plurality of majority class sample clusters.

[0038] The large sample data of adverse drug reactions are historical data of a large number of patients using a drug, including characteristics related to the patient and the drug, mainly including the patient's basic information [gender, age, body mass index (BMI), bad habits, suspected allergic history, whether it is the first time to take the drug, etc.], symptoms, dosing regimen, concomitant medication, ADR situation, efficacy, laboratory tests, evaluation of the rationality of medication, etc.

[0039] The large sample data of adverse drug reactions also includes a target feature of whether an adverse reaction occurs. Due to the rarity of adverse reactions, the large sample data can be divided into a minority sample set where adverse drug reactions occur and a majority sample set where no adverse drug reactions occur according to the target feature.

[0040] The spectral clustering algorithm is a clustering method based on graph theory. It constructs a graph structure based on the similarity between data samples and performs clustering using the eigenvectors of the Laplacian matrix of the graph.

[0041] Apply the spectral clustering algorithm to the majority class sample set to obtain multiple majority class sample clusters, including:

[0042] Calculate the similarity matrix based on the kernel function for the majority class sample subset;

[0043] Constructing a corresponding similarity graph based on the similarity matrix;

[0044] A graph cutting operation is performed on the similarity graph to obtain a plurality of majority class sample clusters, and the similarity of samples in the same majority class sample cluster is higher than the similarity of samples in different sample clusters.

[0045] Since the large sample data of adverse drug reactions has the characteristics of class imbalance, it is of great significance to reasonably reduce the class imbalance of the data for model construction, and mainly spectral clustering resampling is applied to the majority class samples, and the rare and precious minority class samples are not easily changed. The spectral clustering method described in this embodiment includes: for the majority class sample set with huge sample size and high dimension, the similarity matrix of the majority class samples is first obtained by the kernel function, and then a similarity graph is constructed based on the similarity matrix, and finally the sample is clustered by cutting the graph. Each calculation process is a decomposition calculation of a matrix, avoiding the distance measurement and pairwise comparison in the traditional clustering algorithm.

[0046] The specific steps of the spectral clustering algorithm to perform sample partitioning are:

[0047] 1) Calculate the similarity matrix S of the majority class sample set using the kernel method.

[0048] 2) Construct a similarity graph based on the similarity matrix S and establish the corresponding adjacency matrix W and degree matrix D.

[0049] 3) Calculate the Laplace matrix L = DW

[0050] 4) The normalized Laplace matrix is

[0051] 5) Calculate the optimal number of clusters k using the NbClust method.

[0052] 6) Calculation The first k eigenvectors of the matrix u 1 , ..., u k , construct the matrix U = {u 1 , ..., u k}.

[0053] 7) Apply the k-mens clustering algorithm to the observations in the matrix U to obtain clusters C 1 , ..., C k

[0054] 8) Press C 1 , ..., C k The row index of each cluster in corresponds to the index of the initial majority class sample to replace the sample and complete the clustering.

[0055] The divided sample cluster is {C 1 ,...C k ,MI} as an example, where MI is the first sample cluster composed of minority class samples. Compared with the initial data set, the number of samples in each sample cluster is significantly reduced, and the sample feature information in each sample cluster has a high similarity, while the similarity of samples in different clusters is low.

[0056] Step S102, randomly sampling all the plurality of majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples, wherein the plurality of randomly sampled majority class samples constitute a majority class sample subset, wherein the number of samples in the majority class sample subset is the same as or balanced with that in the minority class sample set.

[0057] According to the different sampling areas, it can be divided into three categories: oversampling, undersampling and mixed sampling. The strategy of oversampling is to increase the number of minority samples. The main algorithms are ROS, SMOTE, Borderline-SMOTE, ADASYN, etc.; the strategy of undersampling is to reduce the number of minority samples. The main algorithms are RUS, CNN, ENN, Tomek Links, etc.; the strategy of mixed sampling is to use oversampling and undersampling techniques for two types of samples respectively. The widely used algorithm combinations are SMOTE+RUS, SMOTE+TomekLinks, etc.

[0058] The data resampling method adopted in the present invention belongs to undersampling. The main strategy is to randomly sample from each majority class sample cluster in proportion based on the spectral clustering results of all majority class samples, and sample a total of majority class samples that are consistent with the number of minority class samples.

[0059] Among them, all the majority class sample clusters are randomly sampled in proportion, and the majority class samples obtained by multiple random samplings include:

[0060] All the majority class sample clusters are divided into clusters and randomly sampled in proportion. The number of samples for random sampling is:

[0061]

[0062] Among them, n(C i ) is the i-th sample cluster C i The number of samples included, n(MA) is the total number of majority class samples, and n(MI) is the total number of minority class samples.

[0063] From the majority class sample cluster C i Medium Sampling random samples, n(C i ) is the i-th sample cluster C i The number of samples included, n(MA) is the total number of majority class samples, and n(MI) is the total number of minority class samples. For the i-th majority class sample cluster, the number of samples sampled from it is the same as its proportion in the total majority class samples, that is, The process of randomly sampling each majority class sample cluster in proportion to establish a majority class sample subset, which ensures that the total number of samples after sampling is equal to the total number of minority class samples, and the number of samples contributed by each majority class sample cluster is the same as its proportion in the total.

[0064] In addition, the sample size balance between the majority class sample subset and the minority class sample set refers to the proportional relationship between the sample sizes of the majority class sample subset and the minority class sample set.

[0065] The main advantage of random undersampling based on spectral clustering is that the majority class sample subset obtained by sampling can better represent the initial majority class sample set. The spectral clustering algorithm realizes the reasonable clustering of large sample data in high-dimensional space, and then the samples randomly sampled in proportion from multiple majority class sample clusters well maintain the spatial position distribution and probability density distribution of the initial majority class samples. Moreover, the sampling process does not change the minority class samples in the data, so as to avoid introducing additional noise to the precious minority class sample data.

[0066] Compared with the random undersampling method directly applied to the majority class sample set in the existing solution, the above-mentioned resampling method based on spectral clustering in this embodiment retains the spatial position distribution and probability density distribution of the initial majority class samples to a great extent, so that the sampling process has a theoretical guarantee. As for the selection of clustering algorithms, such as the kmeans or kmodes clustering algorithms, although they are more commonly used, they usually deal with low-dimensional class imbalanced data. When the data is in a high-dimensional space, due to the high-dimensional distance concentration theorem, the Euclidean distance between any sample points tends to be equal. Therefore, the use of the above-mentioned clustering algorithms will make it difficult to ensure the rationality of sample division. Moreover, after calculating the Euclidean distance of all sample pairs, they are gradually compared and divided according to the distance size, which requires a huge amount of calculation, seriously affecting the efficiency of sample division.

[0067] This embodiment adopts the spectral clustering algorithm, measures the similarity between samples based on the kernel function to replace the Euclidean distance calculation, and maintains the computational complexity of sample division at the decomposition and calculation level of a similarity matrix in the form of a cut graph through the spectral method, which effectively avoids the problems of high complexity and unreasonable division of conventional clustering, and has excellent effect. In addition, when the spectral clustering algorithm is used to achieve a good division of the majority class sample set in the data with a large initial sample size and high dimension, it means that the spatial distribution of the majority class sample set has been well divided into multiple subspaces, and the similarity of the feature information of the majority class samples in each subspace is high. Furthermore, some samples are undersampled in proportion from each subspace, and the merged majority class sample subset can still well represent the initial majority class sample spatial distribution, which is equivalent to sparsely sampling the samples in each subspace, but the similarity within each sample cluster and the position of each sample cluster are maintained. Therefore, the majority class sample subset after undersampling can better represent the spatial position distribution and probability density distribution of the initial majority class sample data.

[0068] After spectral clustering and resampling of the majority class sample set, a majority class sample subset that can well represent the spatial location information is obtained for the large sample data of adverse drug reactions. However, since the sampling of each majority class sample cluster is random undersampling, a large number of majority class samples are wasted. Bagging ensemble can effectively reduce the waste of majority class samples by sampling the majority class sample set multiple times and using them for modeling separately.

[0069] In addition, after merging the sampled majority class sample subset with the initial minority class sample set, a balanced subset with equal number of samples in the two classes is obtained. However, compared with the initial large sample data, the sample size of the balanced subset drops sharply while the feature dimension remains unchanged, and the high-dimensional problem of "the number of features is greater than the number of samples" becomes prominent. In addition, the classification algorithms conventionally used for high-dimensional data learning, such as regularization algorithms and dimensionality reduction learning algorithms, may violate the integrated diversity theory.

[0070] Therefore, this embodiment combines the bagging ensemble method and the spectral clustering and resampling method, and performs high-dimensional adaptability improvement, thereby effectively solving the problem of poor sample partitioning balance of large sample data of adverse drug reactions.

[0071] Step S103, based on the Bagging integration strategy, repeatedly apply proportional random sampling T times to multiple majority class sample clusters to construct T majority class sample subsets, and merge them with the minority class sample set respectively to obtain T balanced subsets.

[0072] The Bagging ensemble strategy is an ensemble learning method that improves the performance and stability of the model by constructing multiple base classifiers and then combining their prediction results. The basic idea is to construct multiple sub-datasets by randomly sampling the original data set with replacement, then train different base classifiers on these sub-datasets, and finally combine the prediction results of these classifiers.

[0073] The repeatedly applying T times of proportional random sampling to the plurality of majority class sample clusters comprises:

[0074] According to the sample resampling mechanism with replacement, all multiple majority class sample clusters are randomly sampled T times in proportion to obtain T majority class sample subsets.

[0075] T balanced subsets are generated through multiple resampling modules, and then an optimized Bagging integration framework is established. According to the bootstrap sampling theorem, when the number of resampling with replacement increases, about 63.2% of the samples in each majority class sample cluster will be used to construct a balanced subset to maximize the utilization of the majority class sample data, and then train the base classifier on each balanced subset that is not absolutely the same to establish an integration framework. While each resampling of the basic Bagging integration method is a resampling with replacement to produce a set of the same size as the original data set, this embodiment only resamples proportionally within each majority class sample cluster to maintain the spatial position distribution of the initial data while reducing the learning difficulty, so it belongs to an optimized Bagging integration framework. Subsequently, the optimized Bagging integration framework is applied to potentially learn the classification conditions of the minority class sample set and different majority class sample subsets, implicitly increasing the diversity and correctness of the integrated learning.

[0076] Step S104, for the T balanced subsets, T base classifiers are trained in parallel by using a Boosting ensemble algorithm, and the trained T classifiers are integrated to obtain a prediction model for adverse drug reactions.

[0077] The Boosting ensemble algorithm is an ensemble learning method different from Bagging. It aims to deal with the high-dimensional problem of balancing subsets by combining multiple weak learners (usually decision trees or other simple models) to build a more powerful model as a base classifier. In each round of iteration, the Boosting algorithm pays attention to the samples that were misclassified in the previous round and gives them higher weights, so that subsequent weak learners are more focused on those difficult-to-classify samples. And in each round of iteration, it pays attention to different feature subsets to explore more classification rules.

[0078] The Boosting integrated algorithm includes at least one of the following algorithms: AdaBoost algorithm, GradientBoosting Decision Tree algorithm, XGBoost algorithm, LightGBM algorithm, and CatBoost algorithm.

[0079] The AdaBoost algorithm constructs a strong classifier by combining multiple weak classifiers. The specific operation process is as follows: First, each training sample is assigned a weight, and the weights of all samples are equal at the beginning. Then a weak classifier is selected and trained according to the current sample weight distribution. The trained weak classifier is assigned a weight according to its classification error rate, and the error rate is inversely proportional to the weight. Then the sample weight is updated according to the weight of the weak classifier, that is, the weight of the misclassified sample is increased and the weight of the correctly classified sample is reduced, so that the training of the next weak classifier pays more attention to the misclassified samples. Finally, the outputs of all weak classifiers are weighted and combined into an integrated model. In high-dimensional problems, AdaBoost can handle high-dimensional features by selecting appropriate base classifiers (usually decision trees). Since AdaBoost will gradually adjust the weight of the training data, the samples that were misclassified by the previous round of classifiers will receive more attention in the next round, so it can still effectively learn in high-dimensional problems, improve the diversity of the training process, and learn more data feature information.

[0080] The Gradient Boosting Decision Tree (GBDT) algorithm is also an iterative integrated boosting algorithm with a more direct high-dimensional strategy. The specific operation process is as follows: First, select some features to build an initial weak classifier based on the decision tree algorithm, and calculate the residual between the current prediction result and the true label. In the next iteration, each new decision tree will be designed to fit the residual of the previous decision tree to correct the errors of the previous weak classifier, and finally minimize the overall residual. For high-dimensional problems, since the data and targets faced by each layer of decision tree training process in the GBDT algorithm are different, it can explicitly improve the diversity of the training process, thereby learning more data feature information, exploring different feature spaces on high-dimensional balanced subsets, and finally obtaining a classifier with higher accuracy.

[0081] The XGBoost algorithm is an iterative integrated boosting algorithm. The specific operation process is: first, select a part of the features in the feature space to build a decision tree to learn data classification, and then select some features again to learn the residual of the previous decision tree, that is, focus on the sample points that were misclassified by the previous decision tree, and continuously build new decision trees to reduce the total error until the training accuracy reaches or meets the set conditions. According to the above operation process, the XGBoost algorithm can explore different feature spaces on high-dimensional balanced subsets well, and finally obtain a base classifier with high accuracy. Applying this algorithm on high-dimensional balanced subsets, since the data and goals faced by each layer of decision tree training process are different, it can explicitly improve the diversity of the training process and learn more data feature information.

[0082] The LightGBM algorithm has made some improvements based on the XGBoost algorithm. Consistent with the XGBoost algorithm, each iteration selects some features to build weak classifiers based on decision trees. The difference is that LightGBM uses a histogram-based algorithm to build decision trees. By discretizing the feature values ​​and building histograms, it can more efficiently process data in high-dimensional feature spaces. In each iteration, the LightGBM algorithm splits the decision tree by selecting the feature with the largest gain to reduce the error of the current model. In addition, LightGBM uses a strategy called "gradient-based one-sided sampling" when selecting split features, which can quickly find features with the largest gain, thereby speeding up the training of the model. The LightGBM algorithm can efficiently explore different feature spaces on high-dimensional balanced subsets through histogram-based decision tree construction and gradient-based one-sided sampling strategies.

[0083] The CatBoost algorithm is also an iterative integrated boosting algorithm improved on the basis of the XGBoost algorithm. Consistent with the XGBoost algorithm, each iteration selects some features to build weak classifiers based on the decision tree. The difference is that the CatBoost algorithm introduces a technology called "category feature inference", which can automatically handle the missing values ​​and high cardinality features of discrete features, so as to better utilize the information of these features. In each iteration, the CatBoost algorithm uses the gradient boosting method to train the decision tree model and reduces the error of the current model by minimizing the loss function. In addition, the CatBoost algorithm uses a structure called "symmetric tree", which considers the symmetry of features in the process of building the decision tree, thereby improving the processing efficiency of each feature. The CatBoost algorithm is applied on high-dimensional balanced subsets. Since the data and objectives faced by each layer of the decision tree training process are different, the diversity of the training process can be explicitly improved, so as to learn more data feature information. The CatBoost algorithm can effectively explore different feature spaces on high-dimensional balanced subsets through category feature inference and the structure of symmetric trees.

[0084] The above method adopted in this embodiment can effectively improve the learning ability of the system, improve the existing scheme by adopting simple decision trees, LASSO and other algorithms to establish a base classifier that is as simple as possible, select a small number of sample features for classification learning through only one discrimination, and solve the technical problem that the learning ability of the system is difficult to be logically convincing when solving the high-dimensional class imbalance problem by increasing the number of parallel solutions, and avoid intuitively wasting a large amount of feature information due to simple classifiers, such as wasting a large amount of sample information in the process of forming the sample subset of the system, wasting a large amount of feature information in the target model, etc. This phenomenon will lead to poor performance of the model subsequently constructed by the system.

[0085] The integrated learning strategy of this embodiment includes two integrated strategies: parallel integrated learning on multiple balanced subsets and iterative learning on balanced subsets. The parallel integrated learning process is a Bagging integrated strategy, which can well cope with large sample data of adverse drug reactions with large sample size and serious imbalance in category proportion, and effectively avoid the waste of data samples. Since it is impossible to ensure that the distribution of each balanced subset has significant differences, the number of parallel integrations is generally high, in the hope of potentially improving the diversity and correctness of learning. The iterative integrated learning on each balanced subset is an application of the Boosting algorithm. For any of the algorithms, since each iteration samples part of the sample space and continuously fits the residuals of the previous training process, it can efficiently explore different feature subspaces of the high-dimensional feature space. In addition, in the iterative integration process, the training data and targets of each iteration are different from the previous learning, so the diversity and correctness of learning on high-dimensional balanced subsets can be explicitly improved. It can be seen from this that the ensemble learning of this embodiment is a comprehensive integration of implicit integration and explicit integration, covering the different advantages of Bagging and Boosting strategies, and is used to deal with the two major problems of class imbalance and high dimension of large sample data of adverse drug reactions, respectively, and can effectively improve the accuracy of overall learning.

[0086] For T balanced subsets, T base classifiers are trained in parallel through the Boosting ensemble algorithm, and the trained T classifiers are integrated to obtain a prediction model for adverse drug reactions. Specifically, the model includes:

[0087] From C i Randomly undersample samples in Repeat T sampling to get the subset

[0088] For the tth sampling, merge the minority class sample subset MI and the majority class sample cluster subset Establish a balanced subset M t , t=1,2,...,T.

[0089] In each equilibrium subset M (t) Apply any Boosting algorithm to train the base classifier classifier t .

[0090] The T base classifiers are integrated into the final strong classifier using the average / voting strategy, that is,

[0091]

[0092] or Among them, x i represents an arbitrary data sample.

[0093] Please see Figure 2, which is a flow chart of the application of the method for building a prediction model for adverse drug reactions.

[0094] Spectral clustering module: obtains large sample data of adverse drug reactions. The large sample data includes features related to patients and drugs, as well as target features of whether adverse reactions occur. According to the target features, the large sample data is divided into a minority sample set with adverse drug reactions and a majority sample set with no adverse drug reactions. The spectral clustering algorithm is applied to the majority sample set to obtain multiple majority sample clusters.

[0095] Resampling module: randomly sample all the majority class sample clusters in proportion to obtain multiple randomly sampled majority class samples, and the multiple randomly sampled majority class samples constitute a majority class sample subset, wherein the number of samples in the majority class sample subset is the same as or balanced with that in the minority class sample set.

[0096] Model ensemble training module: Based on the Bagging ensemble strategy, multiple majority class sample clusters are repeatedly subjected to proportional random sampling T times to construct T majority class sample subsets, which are then merged with the minority class sample sets to obtain T balanced subsets. For the T balanced subsets, T base classifiers are trained in parallel using the Boosting ensemble algorithm, and the trained T classifiers are integrated to obtain a prediction model for adverse drug reactions.

[0097] Based on the obtained strong classifier model, it is predicted whether the patient to be tested will have an adverse drug reaction. In addition, the present invention provides a technical idea for the prediction related to adverse drug reactions. For example, the patient's tolerance to a certain type of drug can be predicted to determine which type of tolerance the patient belongs to. It can also be predicted which patients a certain type of drug is effective for and which type of patients the drug has weakened efficacy. Of course, there is no specific limitation, and it can be applied to the prediction and classification of various types of data and various problem requirements.

[0098] The second embodiment of the present invention provides a prediction performance evaluation method, which can evaluate the effect of the prediction and classification method for adverse drug reactions in the first embodiment.

[0099] The prediction performance evaluation method includes: performing performance evaluation on the target model based on accuracy, sensitivity, specificity and area under the ROC curve.

[0100] For example, select data samples with category labels outside the learning process to test the accuracy of the prediction model constructed by this system, and perform classification prediction for subsequent unclassified samples. TP, FP, TN, and FN are the number of correctly classified minority class samples, the number of incorrectly classified minority class samples, the number of correctly classified majority class samples, and the number of incorrectly classified majority class samples in the test set data. When performing performance testing on the target model, this embodiment gives priority to using accuracy, sensitivity, specificity, F1-core, and AUC (area under the ROC curve) as performance evaluation indicators, and the calculation methods of each indicator are as follows:

[0101]

[0102] The AUC is calculated as follows: by setting the classification threshold from 0 to 1, respectively calculating the sensitivity and specificity index values ​​under different classification thresholds and establishing a rectangular coordinate system, connecting all points to draw the ROC curve, and then calculating the area under the curve.

[0103] A third embodiment of the present invention provides a system for constructing a prediction model for adverse drug reactions, which is used to implement any of the prediction model construction methods described above. The system for constructing a prediction model for adverse drug reactions includes:

[0104] The sample partitioning module is used to obtain large sample data of adverse drug reactions. The large sample data includes features related to patients and medicines, as well as target features of whether adverse reactions occur. According to the target features, the large sample data is divided into a minority sample set with adverse drug reactions and a majority sample set with no adverse drug reactions. The spectral clustering algorithm is applied to the majority sample set to obtain multiple majority sample clusters.

[0105] A sampling module is used to randomly sample all the plurality of majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples, wherein the plurality of randomly sampled majority class samples constitute a majority class sample subset, wherein the majority class sample subset has the same number of samples as or is balanced with the minority class sample set;

[0106] A balanced subset construction module is used to repeatedly apply proportional random sampling T times to multiple majority class sample clusters based on the Bagging integration strategy to construct T majority class sample subsets, and merge them with the minority class sample set respectively to obtain T balanced subsets;

[0107] The training model module is used to train T base classifiers in parallel for T balanced subsets through the Boosting ensemble algorithm, integrate the trained T classifiers, and obtain a prediction model for adverse drug reactions.

[0108] A fourth embodiment of the present invention provides a computer-readable storage medium, characterized in that a data processing program is stored on the computer-readable storage medium, and when the data processing program is executed by a processor, the steps of the method for constructing a prediction model for adverse drug reactions described in any one of the above-mentioned methods are implemented.

[0109] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for constructing a prediction model for adverse drug reactions, characterized in that: include: Obtaining large sample data of adverse drug reactions, which includes features related to patients and drugs, and target features of whether adverse reactions occur. According to the target features, the large sample data is divided into a minority sample set with adverse drug reactions and a majority sample set with no adverse drug reactions. A spectral clustering algorithm is applied to the majority sample set to obtain multiple majority sample clusters. Randomly sample all the majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples, and the plurality of randomly sampled majority class samples constitute a majority class sample subset, wherein the number of samples in the majority class sample subset is the same as or balanced with that in the minority class sample set; Based on the Bagging ensemble strategy, the proportional random sampling is repeatedly applied T times to multiple majority class sample clusters to construct T majority class sample subsets, which are then merged with the minority class sample set to obtain T balanced subsets. For T balanced subsets, T base classifiers are trained in parallel using the Boosting ensemble algorithm, and the trained T classifiers are integrated to obtain a prediction model for adverse drug reactions; The method of applying a spectral clustering algorithm to the majority class sample set to obtain a plurality of majority class sample clusters includes: Calculate the similarity matrix of the majority class sample set based on the kernel function; Constructing a corresponding similarity graph based on the similarity matrix; Performing a graph cutting operation on the similarity graph to obtain a plurality of majority class sample clusters, wherein the similarity of samples in the same majority class sample cluster is higher than the similarity of samples in different sample clusters; The method of randomly sampling all the plurality of majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples comprises: All the majority class sample clusters are divided into clusters and randomly sampled in proportion. The number of samples for random sampling is: Among them, n(C i ) is the i-th majority class sample cluster C i The number of samples included, n(MA) is the total number of majority class samples, and n(MI) is the total number of minority class samples.

2. The method for constructing a prediction model for adverse drug reactions according to claim 1, characterized in that: The repeatedly applying T times of proportional random sampling to the plurality of majority class sample clusters comprises: According to the sample resampling mechanism with replacement, all multiple majority class sample clusters are randomly sampled T times in proportion to obtain T majority class sample subsets.

3. The method for constructing a prediction model for adverse drug reactions according to claim 1, characterized in that: The Boosting integrated algorithm includes at least one of the following algorithms: AdaBoost algorithm, Gradient Boosting Decision Tree algorithm, XGBoost algorithm, LightGBM algorithm, and CatBoost algorithm.

4. The method for constructing a prediction model for adverse drug reactions according to claim 1, characterized in that: The T base classifiers after ensemble training include the averaging / voting strategy: or Among them, x i For any data sample, classifier t is the tth classifier.

5. A system for building a prediction model for adverse drug reactions, characterized in that: Used to implement the prediction model construction method according to any one of claims 1 to 4, the prediction model construction system for adverse drug reactions comprises: The sample partitioning module is used to obtain large sample data of adverse drug reactions. The large sample data includes features related to patients and medicines, as well as target features of whether adverse reactions occur. According to the target features, the large sample data is divided into a minority sample set with adverse drug reactions and a majority sample set with no adverse drug reactions. The spectral clustering algorithm is applied to the majority sample set to obtain multiple majority sample clusters. A sampling module is used to randomly sample all the plurality of majority class sample clusters in proportion to obtain a plurality of randomly sampled majority class samples, wherein the plurality of randomly sampled majority class samples constitute a majority class sample subset, wherein the majority class sample subset has the same number of samples as or is balanced with the minority class sample set; A balanced subset construction module is used to repeatedly apply proportional random sampling T times to multiple majority class sample clusters based on the Bagging integration strategy to construct T majority class sample subsets, and merge them with the minority class sample set respectively to obtain T balanced subsets; The training model module is used to train T base classifiers in parallel for T balanced subsets through the Boosting ensemble algorithm, and integrate the trained T classifiers to obtain a prediction model for adverse drug reactions; The sample division module is specifically used for: Calculate the similarity matrix of the majority class sample set based on the kernel function; Constructing a corresponding similarity graph based on the similarity matrix; Performing a graph cutting operation on the similarity graph to obtain a plurality of majority class sample clusters, wherein the similarity of samples in the same majority class sample cluster is higher than the similarity of samples in different sample clusters; The sampling module is specifically used for: All the majority class sample clusters are divided into clusters and randomly sampled in proportion. The number of samples for random sampling is: Among them, n(C i ) is the i-th majority class sample cluster C i The number of samples included, n(MA) is the total number of majority class samples, and n(MI) is the total number of minority class samples.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a data processing program, and when the data processing program is executed by a processor, the steps of the method for constructing a prediction model for adverse drug reactions according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Abnormal data identification method based on artificial intelligence and related devices

    CN111785384A

  • Multi-set unbalanced data classification method and device based on data distribution

    CN116432122A

  • Data fusion and classification with imbalanced datasets

    IL256911A