Resistance gene horizontal migration frequency prediction and model construction method and device

By constructing a multi-layer learner model and combining the fusion strategy of multiple base learners and meta-learners, the problem of insufficient adaptability and interpretation of the risk assessment model of resistance gene transmission in the prior art is solved, and more efficient and reliable prediction results are achieved.

CN119993278AActive Publication Date: 2025-05-13GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510021124.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-13
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

When evaluating the risk of antibiotic resistance gene transmission in the prior art, a single machine learning model lacks adaptability and generalization ability to complex data structures, and has limited explanatory power to the importance of characteristics, lacks standardized processes for data integration and preprocessing, imperfect hyperparameter optimization strategy, and weak interpretability and visualization ability of model results.

Method used

Using a multi-layer learner model, including multiple different and independent base learners on the first layer and a second layer meta-learner, the final prediction is carried out through the Stacking model and the performance of the model is improved through standardized data preprocessing and hyperparameter optimization strategies.

Benefits of technology

The accuracy and reliability of the prediction of the horizontal migration frequency of resistance genes has been significantly improved. Through the importance of stress factors and the visualization of prediction results, it provides strong support for the management and decision-making of antibiotic-resistant gene migration risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119993278A_ABST
    Figure CN119993278A_ABST
Patent Text Reader

Abstract

The invention discloses a resistance gene horizontal migration frequency prediction and model construction method and device. The model construction method comprises the following steps: acquiring target historical sample test data of a preset group number; preprocessing each group of target historical sample test data to obtain multiple groups of target historical preprocessed sample test data; inputting the target historical preprocessing sample test data into a target learner model at the same time for training and outputting target prediction result data, wherein the target learner model comprises a first layer of target base learner and a second layer of target element learner; judging whether the target learner model is successfully trained or not according to target prediction result data; and if yes, taking the successfully trained target learner model as a target resistance gene horizontal migration frequency prediction model. According to the method, the risk of antibiotic resistance gene horizontal migration under various water quality conditions of water samples to be detected can be rapidly evaluated, and the accuracy of predicting the resistance gene horizontal migration frequency can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resistance gene horizontal migration frequency prediction, and in particular to a method and device for resistance gene horizontal migration frequency prediction and model construction. Background Art

[0002] Current studies have shown that antibiotic resistance genes (ARGs) spread between different organisms through horizontal gene transfer (HGT), posing a major threat to public health and environmental safety. Therefore, accurately monitoring the presence of ARGs in the environment and assessing their risk of transmission are crucial to protecting human health. Existing technologies for assessing the risk of ARG transmission mainly include statistical analysis, laboratory simulation studies, and simple machine learning models. Although some progress has been made, there are significant limitations. For example, traditional statistical methods are difficult to handle nonlinear and multi-factor interaction effects; laboratory simulation studies are time-consuming and difficult to expand; single machine learning models lack adaptability and generalization capabilities for complex data structures, and have limited explanatory power for feature importance. In addition, data integration and preprocessing lack standardized processes, hyperparameter optimization strategies are imperfect, and model results are weak in interpretability and visualization. Summary of the invention

[0003] In response to the above problems, the present invention proposes a method and device for predicting the frequency of horizontal migration of resistance genes and building a model to solve the following problems in the prior art: a single machine learning model has insufficient adaptability and generalization ability to complex data structures, and has limited explanatory power for feature importance, and lacks standardized processes for data integration and preprocessing, and the hyperparameter optimization strategy is imperfect, and the interpretability and visualization capabilities of the model results are weak.

[0004] The first technical solution of the embodiment of the present invention is:

[0005] A method for constructing a resistance gene horizontal migration frequency prediction model comprises: obtaining a preset number of target historical sample test data, and labeling all of the target historical sample test data; wherein each group of the target historical sample test data comprises a target stress factor concentration corresponding to a target resistance gene stress factor and a target resistance gene horizontal migration frequency that matches the target stress factor concentration; preprocessing each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, wherein each group of the target historical preprocessed sample test data comprises a target preprocessed stress factor concentration and a target resistance gene horizontal migration frequency that matches the target stress factor concentration. The target pretreatment resistance gene horizontal migration frequency that matches the pretreatment stress factor concentration; all of the target historical pretreatment sample test data are simultaneously input into the target learner model to be trained for training and output target prediction result data, the target learner model includes a first-layer learner and a second-layer learner, the first-layer learner is a plurality of different and independent target base learners, and the second-layer learner is a target meta-learner; according to the target prediction result data, it is judged whether the target learner model has been successfully trained; if so, the target learner model after successful training is used as the target resistance gene horizontal migration frequency prediction model.

[0006] The second technical solution of the embodiment of the present invention is:

[0007] A method for predicting the frequency of horizontal migration of antibiotic resistance genes, which is implemented based on a target resistance gene horizontal migration frequency prediction model constructed by the method for constructing a resistance gene horizontal migration frequency prediction model according to any one of the above claims, and comprises: obtaining all target resistance gene stress factor concentrations corresponding to a target antibiotic water sample to be predicted; pre-treating all of the target resistance gene stress factor concentrations to obtain target pre-treatment resistance gene stress factor concentrations; inputting all of the target pre-treatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and outputting the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample.

[0008] The third technical solution of the embodiment of the present invention is:

[0009] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0010] Obtain a preset number of groups of target historical sample test data, and label all of the target historical sample test data; wherein each group of the target historical sample test data includes a target stress factor concentration corresponding to a target resistance gene stress factor and a target resistance gene horizontal migration frequency matching the target stress factor concentration; preprocess each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, wherein each group of the target historical preprocessed sample test data includes a target preprocessed stress factor concentration and a target preprocessed resistance gene horizontal migration frequency matching the target preprocessed stress factor concentration; simultaneously input all of the target historical preprocessed sample test data into a target learner model to be trained for training and output target prediction result data, the target learner model includes a first layer learner and a second layer learner, the first layer learner is a plurality of different and independent target base learners, and the second layer learner is a target meta learner; according to the target prediction result data, determine whether the target learner model has been successfully trained; if so, use the successfully trained target learner model as a target resistance gene horizontal migration frequency prediction model; or perform the following steps:

[0011] Obtain all target resistance gene stress factor concentrations corresponding to the target antibiotic water sample to be predicted; pre-treat all the target resistance gene stress factor concentrations to obtain target pre-treatment resistance gene stress factor concentrations; input all the target pre-treatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and output the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample.

[0012] The fourth technical solution of the embodiment of the present invention is:

[0013] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:

[0014] Obtain a preset number of groups of target historical sample test data, and label all of the target historical sample test data; wherein each group of the target historical sample test data includes a target stress factor concentration corresponding to a target resistance gene stress factor and a target resistance gene horizontal migration frequency matching the target stress factor concentration; preprocess each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, wherein each group of the target historical preprocessed sample test data includes a target preprocessed stress factor concentration and a target preprocessed resistance gene horizontal migration frequency matching the target preprocessed stress factor concentration; simultaneously input all of the target historical preprocessed sample test data into a target learner model to be trained for training and output target prediction result data, the target learner model includes a first layer learner and a second layer learner, the first layer learner is a plurality of different and independent target base learners, and the second layer learner is a target meta learner; according to the target prediction result data, determine whether the target learner model has been successfully trained; if so, use the successfully trained target learner model as a target resistance gene horizontal migration frequency prediction model; or perform the following steps:

[0015] Obtain all target resistance gene stress factor concentrations corresponding to the target antibiotic water sample to be predicted; pre-treat all the target resistance gene stress factor concentrations to obtain target pre-treatment resistance gene stress factor concentrations; input all the target pre-treatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and output the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample.

[0016] Compared with the prior art, the present invention has the following beneficial effects:

[0017] In the model building stage, the embodiment of the present invention first obtains a preset number of groups of target historical sample test data, then preprocesses each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, and then simultaneously inputs all of the target historical preprocessed sample test data into the target learner model to be trained for training and outputs target prediction result data, the target learner model includes a first layer learner and a second layer learner, the first layer learner is a plurality of different and independent target base learners, the second layer learner is a target meta learner, and finally, based on the target prediction result data, it is determined whether the target learner model has been successfully trained, and if so, the target learner model after successful training is used as a target resistance gene horizontal migration frequency prediction model.

[0018] In the prediction stage, the present invention inputs all the target pretreatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and outputs the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample. The risk of antibiotic resistance gene horizontal migration under various water quality conditions (pH, disinfectant, heavy metals, antibiotics and other organic substances) of the water samples to be tested can be quickly evaluated, and the accuracy and reliability of the resistance gene horizontal migration frequency prediction can be significantly improved. Through the importance ranking of stress factors and the visualization of prediction results, strong support is provided for the management and decision-making of the risk of antibiotic resistance gene horizontal migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] in:

[0021] Figure 1 It is an implementation flow chart of an implementation method of a method for constructing a horizontal migration prediction model of resistance genes in an embodiment;

[0022] Figure 2 It is a flow chart of an implementation method of an embodiment of a method for predicting the horizontal migration frequency of antibiotic resistance genes in an embodiment;

[0023] Figure 3 A flowchart of a prediction model construction method for a resistance gene horizontal migration prediction model in an embodiment;

[0024] Figure 4 This is a ranking diagram of the importance of resistance gene stress factors in an embodiment of a method for predicting the horizontal migration frequency of antibiotic resistance genes;

[0025] Figure 5 A comparison diagram of actual and predicted values ​​of horizontal migration frequency of antibiotic resistance genes in a method for predicting horizontal migration frequency of antibiotic resistance genes in an embodiment;

[0026] Figure 6 A distribution diagram of the residual difference between the actual value and the predicted value of the horizontal migration frequency of antibiotic resistance genes in an embodiment of a method for predicting the horizontal migration frequency of antibiotic resistance genes;

[0027] Figure 7 It is a structural block diagram of an implementation scheme of a computer device in one embodiment. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] See also Figure 1 , combined with Figure 1 It can be seen that the method for constructing the resistance gene horizontal migration prediction model of the embodiment of the present invention includes the following steps:

[0030] Step S101: Obtain a preset number of groups of target historical sample test data, and label all of the target historical sample test data; wherein each group of the target historical sample test data includes a target stress factor concentration corresponding to a target resistance gene stress factor and a target resistance gene horizontal migration frequency matching the target stress factor concentration.

[0031] Among them, the target resistance gene stress factors include water sample pollutants such as heavy metals and disinfectants, and the type, quantity and concentration of the target resistance gene stress factors corresponding to each group of the above-mentioned target historical sample test data are different.

[0032] Among them, labeling all the target historical sample test data means marking the target stress factor concentration of each group and the target resistance gene horizontal migration frequency matching it to distinguish them from other data, and associating the target stress factor concentration of each group and the target resistance gene horizontal migration frequency matching it, one by one.

[0033] Among them, the preset number of groups can be selected to be more than 100 groups. The more historical sample test data of water samples there are, the more accurate the training results will be.

[0034] Step S102: preprocess each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, wherein each group of the target historical preprocessed sample test data includes a target pretreatment stress factor concentration and a target pretreatment resistance gene horizontal migration frequency that matches the target pretreatment stress factor concentration.

[0035] The purpose of preprocessing each group of target historical sample test data is to delete unreasonable data from the original data. In addition, the preprocessing is to unify the data units and standardize the data for the convenience of subsequent model training.

[0036] Step S103: input all of the target historical preprocessed sample test data into the target learner model to be trained at the same time for training and outputting target prediction result data, wherein the target learner model includes a first layer learner and a second layer learner, wherein the first layer learner is a plurality of different and independent target base learners, and the second layer learner is a target meta learner.

[0037] Among them, this step uses the Stacking model to combine multiple base learners and meta-learners as the target learner model to be trained. The Stacking model is a model fusion algorithm. Its basic idea is to reduce the generalization error of a single model by combining the prediction results of multiple models. The Stacking model fusion method is widely used in machine learning. The core idea of ​​the Stacking model fusion method is to use the output data of multiple base learners as new features and input them into a meta-learner for final prediction. The specific steps are as follows:

[0038] First, base learner training: First, use the original data (all the target historical preprocessed sample test data) to train multiple base learners (also called individual learners). These base learners can be different types of models, such as random forests, support vector machines, etc.; then, generate new features: each base learner predicts the training set and the validation set to generate a new feature matrix. These feature matrices are composed of the prediction results of each base learner.

[0039] Second, meta-learner training: First, a meta-learner (also called the final model) is trained using the new feature matrix and the original labels. The meta-learner usually selects a relatively simple but highly interpretable model, such as a decision tree, linear regression, etc. Then, prediction is made: the output of the final model is the prediction result of the Stacking model.

[0040] Among them, Figure 3 As shown, the multiple base learners of the first layer learners in this step can be selected as three regression algorithms: random forest, GradientBoosting (gradient boosting) and XGBoost (optimized distributed gradient boosting library), and the meta learner of the second layer learner in this step can be selected as linear regression with regularization.

[0041] Step S104: judging whether the target learner model has been successfully trained according to the target prediction result data.

[0042] Among them, only when the target prediction result data shown meets the preset conditions can it be said that the target learner model has been successfully trained.

[0043] Step S105: If the target learner model has been successfully trained, the successfully trained target learner model is used as a target resistance gene horizontal migration frequency prediction model.

[0044] Among them, the target learner model after successful training can be directly used as a prediction model to predict the water samples for which the horizontal migration frequency of resistance genes is to be predicted.

[0045] In this embodiment, optionally, preprocessing each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data includes:

[0046] First, delete the abnormal values ​​of the target resistance gene horizontal migration frequency in each group of the target historical sample test data, and the order of magnitude of the abnormal values ​​of the target resistance gene horizontal migration frequency is different from the order of magnitude of the remaining normal target resistance gene horizontal migration frequencies.

[0047] Among them, as shown in Table 1 below, it is a part of the target historical sample test data, with a total of 12 groups of sample data. Among them, copper, zinc, lead, glutaraldehyde, decanyl methyl ammonium bromide and glutaraldehyde decanyl methyl ammonium bromide compound are the target resistance gene stress factors, copper, zinc and lead are heavy metals, glutaraldehyde, decanyl methyl ammonium bromide and glutaraldehyde decanyl methyl ammonium bromide compound are disinfectants.

[0048]

[0049] Table 1

[0050] Among them, the different target resistance gene stress factors in Table 1 (copper, zinc, lead, glutaraldehyde, decanediamine bromide and glutaraldehyde-decanediamine bromide composite) are used as input features to predict the output variable (i.e., the horizontal migration frequency of the resistance gene).

[0051] Among them, for example, the data corresponding to No. 8 in Table 1, since the horizontal migration frequency of the resistance gene of the target resistance gene stress factor has a large abnormal fluctuation relative to the values ​​of other cases (3.99% is quite different from 25.43%, 28.16%, etc., which are not of the same order of magnitude, and there is obviously a large deviation, which is abnormal data), the entire row of No. 8 is directly deleted, and the number of sample groups is changed from 12 to 11, which becomes the following Table 2.

[0052]

[0053] Table 2

[0054] Second, the number 0 is used to fill in the null value in the target stress factor concentration.

[0055] Among them, zinc, lead, decylmethylammonium bromide and glutaraldehyde-decylmethylammonium bromide composite in No. 1 in Table 1 are all null values, indicating that these types of stress factors are not contained in this case, so the "0" value is directly used to supplement and obtain the data of No. 1 in Table 2.

[0056] Third, the null value of the target resistance gene horizontal migration frequency is supplemented by the average value of the target resistance gene horizontal migration frequency, and the average value of the target resistance gene horizontal migration frequency is the average value of all normal target resistance gene horizontal migration frequencies.

[0057] Among them, as in No. 11 in Table 1, the horizontal migration frequency of resistance genes is a null value, so the average value of the horizontal migration frequency of resistance genes of the collected data is calculated to be 31.43%, and the average value is filled in the null value. In Table 2, the data 31.43% in No. 11 is expressed as 0.3143.

[0058] Fourth, the concentration units of all the target stress factors are unified as mg / L.

[0059] The concentration units of the collected data are all μg / mL, and the concentration units of all the target stress factors are unified into mg / L. The unified concentration values ​​are conducive to training and ensure the consistency and comparability between the data.

[0060] Fifth, unify the numerical types of all the target resistance gene horizontal migration frequencies into decimals.

[0061] Among them, if the horizontal migration frequency of the resistance gene in No. 1 is converted from 21.95% to the decimal form 0.2195, it is convenient for statistics and training.

[0062] In this embodiment, optionally, preprocessing each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data includes:

[0063] The target stress factor concentration is standardized and converted according to the target preset formula, and the target preset formula is:

[0064] Among them, x new is the target pretreatment stress factor concentration obtained after standardized conversion, x is the target stress factor concentration, μ is the average value of all the target stress factor concentrations, and is the standard deviation of all the target stress factor concentrations.

[0065] In this embodiment, optionally, the step of simultaneously inputting all of the target historical preprocessed sample test data into the target learner model to be trained for training and outputting target prediction result data includes:

[0066] First, all the target historical preprocessed sample test data are divided into a target preprocessed sample training data set and a target preprocessed sample test data set, wherein the number of groups of the target preprocessed sample training data set is greater than the number of groups of the target preprocessed sample test data set.

[0067] The number of the target preprocessed sample training data set may be selected to account for 80% of the total number of target historical preprocessed sample trials, and the number of the target preprocessed sample test data set may be selected to account for 20% of the total number of target historical preprocessed sample trials.

[0068] Second, the target preprocessed sample training data set and the target preprocessed sample test data set are simultaneously input into a plurality of different and independent target base learners corresponding to the first layer learner for training, and the target base learner training result data and the target base learner test result data are output.

[0069] Among them, Figure 3 As shown, the multiple different and independent target base learners corresponding to the first layer learners are independent of each other, and their training does not interfere with each other. The training results output by each base learner are also independent of each other. Model 1, Model 2 and Model 3 are different from each other, and the output prediction results of Model 1, Model 2 and Model 3 are also independent of each other.

[0070] Third, the target base learner training result data and the target base learner test result data are input into the target meta-learner corresponding to the second-layer learner for training to obtain target training set prediction result data and target test set prediction result data, and the target training set prediction result data and the target test set prediction result data are used together as the target prediction result data.

[0071] The prediction results of model 1, model 2 and model 3 form a new data set and are then input into the target meta-learner corresponding to the second layer learner for training. The prediction results of model 1, model 2 and model 3 are all composed of the predicted frequency of horizontal migration of resistance genes output by the base learner and the target pretreatment stress factor concentration matched therewith.

[0072] In this embodiment, optionally, judging whether the target learner model has been successfully trained according to the target prediction result data includes:

[0073] First, the target prediction result data is input into the following target preset verification formula for calculation to obtain the target verification result data;

[0074]

[0075] Second, determine whether the target result data satisfies the target conditions at the same time: R 2 Whether the absolute value of the difference between RMSE and MSE and 1 is less than the target preset regression coefficient difference threshold, and whether the absolute value of the difference between RMSE and MSE and the target preset verification value is less than the target preset variance difference threshold.

[0076] Among them, as shown in Table 3, it is one of the conditions that the target result data satisfies simultaneously, the training set in Table 3 corresponds to the target preprocessed sample training data set, and the test set in Table 3 corresponds to the target preprocessed sample test data set.

[0077]

[0078] Table 3

[0079] Third, if the target result data satisfies the target conditions at the same time, it is determined that the target learner model has been trained successfully.

[0080] Among them, y i represents the horizontal migration frequency of the target pretreatment resistance gene of the i-th group of the target historical pretreatment sample test data; represents the predicted value of the horizontal migration frequency of the resistance gene corresponding to the target pretreatment stress factor concentration of the i-th group of the target historical pretreatment sample test data; N represents the total number of samples corresponding to the target historical pretreatment sample test data; is the average value corresponding to the horizontal migration frequency of all the target pretreatment resistance genes, R 2 is the regression coefficient, RMSE is the root mean square error, and MSE is the mean square error.

[0081] See also Figure 2 , combined with Figure 2 It can be obtained that a method for predicting the horizontal migration frequency of an antibiotic resistance gene in an embodiment of the present invention is implemented based on a target resistance gene horizontal migration frequency prediction model constructed by the method for constructing a resistance gene horizontal migration frequency prediction model according to any one of the above claims, and includes:

[0082] Step S201: Obtain the concentrations of all target resistance gene stress factors corresponding to the target antibiotic water sample to be predicted.

[0083] Step S202: pre-treating all of the target resistance gene stress factor concentrations to obtain target pre-treated resistance gene stress factor concentrations.

[0084] The preprocessing method in this step is the same as the preprocessing method in the above step S102.

[0085] Step S203: inputting all of the target pretreatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and outputting the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample.

[0086] In this embodiment, optionally, the step of inputting all of the target pretreatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and outputting the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample, followed by:

[0087] According to the predicted frequency of horizontal migration of the target antibiotic resistance gene, an importance ranking diagram of the target resistance gene stress factor corresponding to the target antibiotic water sample, a comparison diagram of the actual value and predicted value of the horizontal migration frequency of the target resistance gene, and a residual distribution diagram of the actual value and predicted value of the horizontal migration frequency of the target resistance gene are generated, such as Figure 4 , 5 and 6.

[0088] in, Figure 5 The actual value of the horizontal migration frequency of antibiotic resistance genes is the horizontal axis, and the predicted value is the vertical axis, so Python's p lt.scatter is used for plotting; Figure 6 The predicted value is the horizontal axis, and the residual (i.e. the actual value of the horizontal migration frequency of antibiotic resistance genes minus the predicted value) is the vertical axis, and Python's plt.scatter is used for plotting.

[0089] In this embodiment, optionally, the pretreatment of all the target resistance gene stress factor concentrations to obtain the target pretreated resistance gene stress factor concentration comprises:

[0090] First, the null values ​​in all the target resistance gene stress factor concentrations are supplemented with the number 0, and the concentration units of all the target resistance gene stress factor concentrations are unified as mg / L to obtain the target pretreatment resistance gene stress factor concentration data.

[0091] Second, all the target resistance gene stress factor concentrations are standardized according to the target preset formula, and the target preset formula is:

[0092] Among them, x new is the target pretreatment stress factor concentration obtained after standardized conversion, x is the target stress factor concentration, μ is the average value of all the target stress factor concentrations, and is the standard deviation of all the target stress factor concentrations.

[0093] Figure 7FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server. Figure 3 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the above-mentioned method for constructing a horizontal migration prediction model of resistance genes. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the above-mentioned method for constructing a horizontal migration prediction model of resistance genes. Those skilled in the art can understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0094] In another embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:

[0095] Obtain a preset number of groups of target historical sample test data, and label all of the target historical sample test data; wherein each group of the target historical sample test data includes a target stress factor concentration corresponding to a target resistance gene stress factor and a target resistance gene horizontal migration frequency matching the target stress factor concentration; preprocess each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, wherein each group of the target historical preprocessed sample test data includes a target preprocessed stress factor concentration and a target preprocessed resistance gene horizontal migration frequency matching the target preprocessed stress factor concentration; simultaneously input all of the target historical preprocessed sample test data into a target learner model to be trained for training and output target prediction result data, the target learner model includes a first layer learner and a second layer learner, the first layer learner is a plurality of different and independent target base learners, and the second layer learner is a target meta learner; according to the target prediction result data, determine whether the target learner model has been successfully trained; if so, use the successfully trained target learner model as a target resistance gene horizontal migration frequency prediction model; or perform the following steps:

[0096] Obtain all target resistance gene stress factor concentrations corresponding to the target antibiotic water sample to be predicted; pre-treat all the target resistance gene stress factor concentrations to obtain target pre-treatment resistance gene stress factor concentrations; input all the target pre-treatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and output the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample.

[0097] In another embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the processor performs the following steps:

[0098] Obtain a preset number of groups of target historical sample test data, and label all of the target historical sample test data; wherein each group of the target historical sample test data includes a target stress factor concentration corresponding to a target resistance gene stress factor and a target resistance gene horizontal migration frequency matching the target stress factor concentration; preprocess each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, wherein each group of the target historical preprocessed sample test data includes a target preprocessed stress factor concentration and a target preprocessed resistance gene horizontal migration frequency matching the target preprocessed stress factor concentration; simultaneously input all of the target historical preprocessed sample test data into a target learner model to be trained for training and output target prediction result data, the target learner model includes a first layer learner and a second layer learner, the first layer learner is a plurality of different and independent target base learners, and the second layer learner is a target meta learner; according to the target prediction result data, determine whether the target learner model has been successfully trained; if so, use the successfully trained target learner model as a target resistance gene horizontal migration frequency prediction model; or perform the following steps:

[0099] Obtain all target resistance gene stress factor concentrations corresponding to the target antibiotic water sample to be predicted; pre-treat all the target resistance gene stress factor concentrations to obtain target pre-treatment resistance gene stress factor concentrations; input all the target pre-treatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and output the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample.

[0100] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0101] In the model building stage, the embodiment of the present invention first obtains a preset number of groups of target historical sample test data, then preprocesses each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, and then simultaneously inputs all of the target historical preprocessed sample test data into the target learner model to be trained for training and outputs target prediction result data, the target learner model includes a first layer learner and a second layer learner, the first layer learner is a plurality of different and independent target base learners, the second layer learner is a target meta learner, and finally, based on the target prediction result data, it is determined whether the target learner model has been successfully trained, and if so, the target learner model after successful training is used as a target resistance gene horizontal migration frequency prediction model.

[0102] In the prediction stage, the present invention inputs all the target pretreatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and outputs the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample. The risk of horizontal migration of antibiotic resistance genes under various water quality conditions (pH, disinfectants, heavy metals, antibiotics and other organic substances) of the water samples to be tested can be quickly evaluated, and the accuracy and reliability of the resistance gene horizontal migration frequency prediction can be significantly improved. Through the importance ranking of stress factors and the visualization of prediction results, strong support is provided for the management and decision-making of antibiotic resistance gene migration risks.

[0103] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0104] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for constructing a resistance gene horizontal migration frequency prediction model, characterized in that: include: Obtaining a preset number of groups of target historical sample test data, and labeling all of the target historical sample test data; wherein each group of the target historical sample test data includes a target stress factor concentration corresponding to a target resistance gene stress factor and a target resistance gene horizontal migration frequency matching the target stress factor concentration; Preprocessing each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data, wherein each group of the target historical preprocessed sample test data includes a target preprocessed stress factor concentration and a target preprocessed resistance gene horizontal migration frequency that matches the target preprocessed stress factor concentration; Inputting all the target historical preprocessed sample test data into the target learner model to be trained at the same time for training and outputting target prediction result data, wherein the target learner model includes a first layer learner and a second layer learner, wherein the first layer learner is a plurality of different and independent target base learners, and the second layer learner is a target meta learner; According to the target prediction result data, determining whether the target learner model has been successfully trained; If so, the target learner model after successful training is used as the target resistance gene horizontal migration frequency prediction model.

2. The method for constructing a resistance gene horizontal migration frequency prediction model according to claim 1, characterized in that: The preprocessing of each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data includes: Deleting abnormal values ​​of the target resistance gene horizontal migration frequency in each group of the target historical sample test data, wherein the order of magnitude of the abnormal values ​​of the target resistance gene horizontal migration frequency is different from the order of magnitude of the remaining normal target resistance gene horizontal migration frequencies; The number 0 is used to fill the empty value in the concentration of the target stress factor; The null value of the target resistance gene horizontal migration frequency is supplemented by the average value of the target resistance gene horizontal migration frequency, and the average value of the target resistance gene horizontal migration frequency is the average value of all normal target resistance gene horizontal migration frequencies; The concentration units of all the target stress factors are unified as mg / L; The numerical types of all the horizontal migration frequencies of the target resistance genes are unified into decimals.

3. The method for constructing a resistance gene horizontal migration frequency prediction model according to claim 1, characterized in that: The preprocessing of each group of the target historical sample test data to obtain multiple groups of target historical preprocessed sample test data includes: The target stress factor concentration is standardized and converted according to the target preset formula, and the target preset formula is: Among them, x new is the target pretreatment stress factor concentration obtained after standardized conversion, x is the target stress factor concentration, μ is the average value of all the target stress factor concentrations, and is the standard deviation of all the target stress factor concentrations.

4. The method for constructing a resistance gene horizontal migration frequency prediction model according to claim 1, characterized in that: The step of simultaneously inputting all the target historical preprocessed sample test data into the target learner model to be trained for training and outputting target prediction result data includes: Dividing all of the target historical preprocessed sample test data into a target preprocessed sample training data set and a target preprocessed sample test data set, wherein the number of groups of the target preprocessed sample training data set is greater than the number of groups of the target preprocessed sample test data set; Inputting the target preprocessed sample training data set and the target preprocessed sample test data set into a plurality of different and independent target base learners corresponding to the first layer learners for training at the same time, and outputting target base learner training result data and target base learner test result data; The target base learner training result data and the target base learner test result data are input into the target meta learner corresponding to the second layer learner for training to obtain target training set prediction result data and target test set prediction result data, and the target training set prediction result data and the target test set prediction result data are used together as the target prediction result data.

5. The method for constructing a resistance gene horizontal migration frequency prediction model according to claim 1, characterized in that: The step of judging whether the target learner model has been successfully trained according to the target prediction result data includes: The target prediction result data is input into the following target preset verification formula for calculation to obtain the target verification result data; Second, determine whether the target result data satisfies the target conditions at the same time: R 2 Whether the absolute value of the difference between RMSE and MSE and 1 is less than the target preset regression coefficient difference threshold, and whether the absolute value of the difference between RMSE and MSE and the target preset verification value is less than the target preset variance difference threshold. If so, it is determined that the target learner model has been trained successfully. Among them, y i represents the horizontal migration frequency of the target pretreatment resistance gene of the i-th group of the target historical pretreatment sample test data; represents the predicted value of the horizontal migration frequency of the resistance gene corresponding to the target pretreatment stress factor concentration of the i-th group of the target historical pretreatment sample test data; N represents the total number of samples corresponding to the target historical pretreatment sample test data; is the average value corresponding to the horizontal migration frequency of all the target pretreatment resistance genes, R 2 is the regression coefficient, RMSE is the root mean square error, and MSE is the mean square error.

6. A method for predicting the horizontal migration frequency of antibiotic resistance genes, which is implemented based on a target resistance gene horizontal migration frequency prediction model constructed by the method for constructing a resistance gene horizontal migration frequency prediction model according to any one of claims 1 to 5, characterized in that: include: Obtaining the concentrations of all target resistance gene stress factors corresponding to the target antibiotic water sample to be predicted; Pre-treating all of the target resistance gene stress factor concentrations to obtain target pre-treated resistance gene stress factor concentrations; All of the target pretreatment resistance gene stress factor concentrations are input into the target resistance gene horizontal migration frequency prediction model for processing, and the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample is output.

7. The method for predicting the frequency of horizontal migration of antibiotic resistance genes according to claim 6, characterized in that: The method comprises: inputting all the target pretreatment resistance gene stress factor concentrations into the target resistance gene horizontal migration frequency prediction model for processing, and outputting the target antibiotic resistance gene horizontal migration prediction frequency corresponding to the target antibiotic water sample, and then comprising: According to the predicted frequency of horizontal migration of the target antibiotic resistance gene, an importance ranking diagram of target resistance gene stress factors corresponding to the target antibiotic water sample, a comparison diagram of actual value and predicted value of target resistance gene horizontal migration frequency, and a residual distribution diagram of actual value and predicted value of target resistance gene horizontal migration frequency are generated.

8. The method for predicting the frequency of horizontal migration of antibiotic resistance genes according to claim 6, characterized in that: The pretreatment of all the target resistance gene stress factor concentrations to obtain the target pretreated resistance gene stress factor concentration comprises: The null values ​​in all the target resistance gene stress factor concentrations are supplemented with the number 0, and the concentration units of all the target resistance gene stress factor concentrations are unified as mg / L to obtain the target pretreatment resistance gene stress factor concentration data; The concentrations of all target resistance gene stress factors are standardized according to the target preset formula, and the target preset formula is: Among them, x new is the target pretreatment stress factor concentration obtained after standardized conversion, x is the target stress factor concentration, μ is the average value of all the target stress factor concentrations, and is the standard deviation of all the target stress factor concentrations.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the processor executes the method for constructing a resistance gene horizontal migration frequency prediction model as described in any one of claims 1 to 5, or executes the method for predicting the antibiotic resistance gene horizontal migration frequency as described in any one of claims 6 to 8.

10. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method for constructing a resistance gene horizontal migration frequency prediction model as described in any one of claims 1 to 5, or executes the method for predicting the antibiotic resistance gene horizontal migration frequency as described in any one of claims 6 to 8.

Citation Information

Patent Citations

  • Antibiotic pollution migration prediction method and system in underground water environment

    CN117172990A

  • Plant antibiotic resistance gene transmission evaluation method and device based on machine learning

    CN119028445A