Yield prediction method, device and electronic equipment
By converting the original reaction sample data into vector fingerprint data and eliminating the unqualified data before model training, the problem of abnormal data in small data sets affecting model prediction is solved, and the accuracy and reliability of yield prediction is improved.
Patent Information
- Application Number
- CN202510026334.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2045-01-08
AI Technical Summary
When building machine learning models, it is difficult to effectively process potential anomalies in small data sets, resulting in model prediction bias.
By using the preset open source toolkit Rdkit to convert the original reaction sample data into vector fingerprint data, and eliminate unqualified data through multiple random sampling and predictive capability evaluation mechanisms before model training, thereby building a high-quality sample data set.
It improves the prediction accuracy of the model, reduces the impact of noise data on model training, and ensures the accuracy and reliability of the model input data.
Smart Images

Figure CN119446313B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of yield prediction, and in particular to a yield prediction method, device and electronic equipment. Background Art
[0002] Carbon-carbon, carbon-heterobond coupling and chirality construction are very important in pharmaceutical chemistry. Conventional methods require the use of precious metal catalysis and heating, which has a large energy loss. Photocatalysis can synthesize drug intermediates in a greener way. Compared with traditional methods such as studying reaction mechanisms or using experimental design (DoE) to analyze influencing factors, the use of AI combined with computational chemistry technology can not only systematically study the reaction and understand the factors that affect the reaction effect (conversion rate and stereoselectivity), but also use models to speed up the solution of problems in practical applications and promote the application of photochemical reactions.
[0003] However, existing technical solutions for building machine learning models often require massive amounts of real data for model training, because the correct data often accounts for a larger proportion of massive data, and the model can learn knowledge from massive data and ignore the erroneous data. In the context of the current reaction type small data set, the small amount of data accumulated in the laboratory can easily lead to errors due to manual entry errors or experimental errors. The model learns wrong knowledge and will produce deviations in prediction.
[0004] Conventional data cleaning methods for machine learning models often involve deleting columns with the most missing values, or performing simple routine operations such as converting preprocessed data sets into tensor formats, or directly throwing massive amounts of data into the model for learning. This is because when the amount of data is sufficient, high-quality data accounts for a larger proportion, and the model will automatically ignore the impact of erroneous data. However, there is currently no data cleaning method for hundreds of small data sets in the field of chemistry, and there is no yield prediction method, device, or electronic device. Summary of the invention
[0005] The present invention provides a yield prediction method, device and electronic device, which can eliminate potential abnormal data in advance during the sample data set construction stage before model training for hundreds of small data sets, so as to improve subsequent model performance, ensure data quality from the data source, and improve the accuracy of yield prediction.
[0006] In a first aspect, the present invention provides a yield prediction method, comprising:
[0007] For each original reaction sample data in the photocatalytic asymmetric reaction, the original reaction sample data is converted into vector fingerprint data using a preset open source toolkit Rdkit, and a sample data set is constructed according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data;
[0008] Performing multiple random sampling on the sample data set to obtain multiple training and testing sets, wherein the training and testing sets include a training set and a testing set, and the training set and the testing set in each training and testing set are different;
[0009] For any training test set, the prediction ability of the vector fingerprint data is determined according to the yield prediction result of each vector fingerprint data in the test set, and all training test sets are traversed. When the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the data to be eliminated are eliminated from all the original reaction sample data to obtain the reaction sample data after elimination;
[0010] Input the target reaction data into the preset yield prediction model to obtain the target yield output by the preset yield prediction model, wherein the preset yield prediction model is determined after training based on all the post-elimination reaction sample data and the sample yield corresponding to each post-elimination reaction sample data.
[0011] According to the yield prediction method provided by the present invention, the original reaction sample data is simplified molecular linear input specification data. Before converting the original reaction sample data into vector fingerprint data using a preset open source toolkit Rdkit, the method further includes:
[0012] All original reaction sample data and the sample yield corresponding to each original reaction sample data are obtained from the preset reaction database.
[0013] According to the yield prediction method provided by the present invention, the original reaction sample data is converted into vector fingerprint data using a preset open source toolkit Rdkit, and a sample data set is constructed according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data, including:
[0014] Using a preset open source toolkit Rdkit, the raw reaction sample data of (X, 2) dimension is converted into vector fingerprint data of (X, 2048) dimension, where X is the total number of raw reaction sample data in the preset reaction database;
[0015] According to the vector fingerprint data of (X, 2048) dimension and the sample yield corresponding to each vector fingerprint data, a sample data set of (X, 2049) dimension is constructed.
[0016] According to the yield prediction method provided by the present invention, for any training test set, determining the prediction ability of the vector fingerprint data according to the yield prediction result of each vector fingerprint data in the test set includes:
[0017] For any training test set, an original yield prediction model is trained according to the training set in the training test set, and each vector fingerprint data in the test set corresponding to the training test set is respectively input into the original yield prediction model to obtain the initial predicted yield corresponding to each vector fingerprint data output by the original yield prediction model;
[0018] Determining a yield deviation value according to the sample yield corresponding to the vector fingerprint data and the initial predicted yield;
[0019] Determining the prediction capability of the vector fingerprint data according to the yield deviation value and the preset deviation value;
[0020] The original yield prediction model is a Lasso regression model.
[0021] According to the yield prediction method provided by the present invention, determining the prediction capability of the vector fingerprint data according to the yield deviation value and the preset deviation value includes:
[0022] In the case where the yield deviation value is greater than a preset deviation value, determining that the prediction capability of the vector fingerprint data is unqualified;
[0023] When the yield deviation value is less than or equal to the preset deviation value, it is determined that the prediction ability of the vector fingerprint data is qualified.
[0024] According to the yield prediction method provided by the present invention, before removing all the data to be removed from all the original reaction sample data to obtain the reaction sample data after removal, the method further includes:
[0025] When it is determined that the number of all data to be eliminated is greater than the preset number, increasing the preset deviation value to re-determine all data to be eliminated;
[0026] The preset number is determined according to the total number of all original reaction sample data and a first preset coefficient.
[0027] According to the yield prediction method provided by the present invention, the traversal of all training test sets, when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, determines that the original reaction sample data corresponding to the vector fingerprint data is data to be eliminated, includes:
[0028] Traverse all training and test sets to obtain the prediction ability of each training and test set corresponding to each vector fingerprint data in the test set;
[0029] For any vector fingerprint data in the test set corresponding to each training test set, count the number of times the prediction ability of the vector fingerprint data is unqualified, and determine the preset number of times according to the total number of times the vector fingerprint data participates in the prediction and the second preset coefficient;
[0030] When the prediction ability of the vector fingerprint data is unqualified for more than the preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the vector fingerprint data in the test set corresponding to all training test sets are traversed to obtain all the data to be eliminated.
[0031] According to the yield prediction method provided by the present invention, the sample data set is randomly sampled multiple times to obtain multiple training and testing sets, including:
[0032] Repeat the following steps:
[0033] Using a random number generator to generate a random permutation sequence of length Y, processing the sample data set according to the random permutation sequence to obtain a training test set, until multiple random samplings are completed to obtain multiple training test sets;
[0034] Wherein, Y is the total amount of data in the sample data set. The first 80% of the data in each training and test set is the training set, and the last 20% of the data is the test set.
[0035] In a second aspect, a yield prediction device is provided, comprising:
[0036] A construction unit is used to convert each original reaction sample data in the photocatalytic asymmetric reaction into vector fingerprint data using a preset open source toolkit Rdkit, and construct a sample data set according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data;
[0037] A sampling unit, used for performing multiple random sampling on the sample data set to obtain multiple training and testing sets, wherein the training and testing sets include a training set and a testing set, and the training set and the testing set in each training and testing set are different;
[0038] A determination unit is used to determine the prediction ability of the vector fingerprint data according to the yield prediction result of each vector fingerprint data in the test set for any training test set, traverse all training test sets, and when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, determine the original reaction sample data corresponding to the vector fingerprint data as the data to be eliminated, eliminate all the data to be eliminated from all the original reaction sample data, and obtain the reaction sample data after elimination;
[0039] An input unit is used to input target reaction data into a preset yield prediction model to obtain a target yield output by the preset yield prediction model, wherein the preset yield prediction model is determined after training based on all post-elimination reaction sample data and the sample yield corresponding to each post-elimination reaction sample data.
[0040] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the yield prediction method is implemented when the processor executes the program.
[0041] Aiming at the scenario where the amount of photochemical real reaction data is small, the present invention uses the preset open source toolkit Rdkit, and the original reaction sample data SMILES is efficiently converted into vector fingerprint data, which not only retains the key information of the chemical structure, but also makes the data more suitable for subsequent machine learning processing. A prediction ability evaluation mechanism is introduced to determine its prediction ability according to the yield prediction result of the vector fingerprint data, and unqualified data is eliminated accordingly to reduce the impact of noise data on model training. It can automatically clean out outlier data based on a small amount of photocatalytic asymmetric reaction data already available in the laboratory, and use the reaction sample data after elimination to train a preset yield prediction model, thereby ensuring the accuracy and reliability of the model input data and improving the prediction accuracy of the model;
[0042] The present invention can clean the data before machine learning modeling for a small number of data sets (hundreds). When the number of all data to be eliminated is greater than the preset number, the preset deviation value is increased, and all data to be eliminated are re-determined to ensure that the number of all data to be eliminated for model training is not too low. By flexibly setting the preset deviation value, it can be adjusted according to actual conditions to adapt to different data sets and prediction needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0044] Figure 1 This is one of the flow diagrams of the yield prediction method provided by the present invention;
[0045] Figure 2 This is the second flow chart of the yield prediction method provided by the present invention;
[0046] Figure 3 It is a schematic diagram of the structure of the yield prediction device provided by the present invention;
[0047] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0049] In the existing technical solutions, it often takes tens of thousands of data to build a good model for machine learning models. Most of these methods use public data sets. The amount of data is crucial for model training. When the amount of data is relatively large, the proportion of correct data is larger than that of abnormal data. Therefore, the model can learn the correct knowledge from a large amount of data and ignore the influence of outliers, thereby having better performance in future predictions. There is only a small amount of experimental data in the laboratory for photocatalytic asymmetric reactions, and it is impossible to do a large number of experiments at any cost to collect yields for model training. At the same time, it is difficult for existing solutions to have better performance in the case of a small amount of training data. The main reason is that the model cannot identify the abnormal data therein. The negative impact of abnormal data on the model in a small data set is relatively large. The training process performs indiscriminate learning on the wrong data. In order to improve the prediction accuracy, the model is easy to predict the mean, thereby improving the prediction accuracy of the overall data set. Therefore, the technical solution disclosed in the present invention aims to clean out the outlier points in the training data set in advance, improve the quality of training data, and improve the accuracy of photocatalytic asymmetric reaction yield prediction from the source.
[0050] Figure 1 It is one of the flow diagrams of the yield prediction method provided by the present invention, and the yield prediction method comprises:
[0051] Step 101: for each original reaction sample data in the photocatalytic asymmetric reaction, the original reaction sample data is converted into vector fingerprint data using a preset open source toolkit Rdkit, and a sample data set is constructed according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data;
[0052] Step 102: performing multiple random sampling on the sample data set to obtain multiple training and testing sets, wherein the training and testing sets include a training set and a testing set, and the training set and the testing set in each training and testing set are different;
[0053] Step 103: for any training test set, the prediction ability of the vector fingerprint data is determined according to the yield prediction result of each vector fingerprint data in the test set, and all training test sets are traversed. When the number of times that the prediction ability of any vector fingerprint data is unqualified exceeds a preset number, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the data to be eliminated are eliminated from all the original reaction sample data to obtain the reaction sample data after elimination;
[0054] Step 104, input the target reaction data into a preset yield prediction model to obtain the target yield output by the preset yield prediction model, wherein the preset yield prediction model is determined after training based on all the post-elimination reaction sample data and the sample yield corresponding to each post-elimination reaction sample data.
[0055] In step 101, firstly, the open source toolkit Rdkit is used, which can convert the simplified molecular linear input specification (SMILES) into vector fingerprint data. SMILES is a specification that uses ASCII strings to clearly describe molecular structures, while vector fingerprints are a method of converting molecular structure information into numerical vectors, which is convenient for subsequent machine learning model processing. For each original reaction sample data in the photocatalytic asymmetric reaction, the SMILES string of its product part is extracted and converted into 2048-dimensional vector fingerprint data using Rdkit. At the same time, the sample yield (Yield) corresponding to each vector fingerprint data is retained, and the converted vector fingerprint data and the corresponding sample yield are combined to construct a sample data set, which will be used for subsequent model training and testing. By converting SMILES into vector fingerprints, the present invention can more accurately characterize molecular information and improve the recognition ability of the machine learning model for molecular structure.
[0056] Optionally, the present invention uses the Morgan fingerprint (FingerPrint, FP) algorithm in the open source toolkit such as Rdkit to convert SMILES into vector fingerprints to characterize molecular information, which can be used for similarity comparison, machine learning model training, etc. Yield (Yield) or reaction yield, also known as yield, is generally used in chemical and industrial production. It refers to the ratio of the actual production output of the product obtained by inputting a unit amount of raw materials in a chemical reaction or related chemical industrial production to the theoretically calculated product output. The same chemical reaction will have different yields at different air pressures and temperatures. Generally speaking, a yield of more than 90% is a very high yield, more than 75% is a good yield, about 60% is a general yield, and less than 30% is a very low yield.
[0057] Optionally, the original reaction sample data is simplified molecular linear input specification data. Before converting the original reaction sample data into vector fingerprint data using a preset open source toolkit Rdkit, the method further includes:
[0058] All original reaction sample data and the sample yield corresponding to each original reaction sample data are obtained from the preset reaction database.
[0059] Optionally, before executing step 101, all original reaction sample data and the sample yield corresponding to each original reaction sample data are obtained from a preset reaction database, wherein the preset reaction database stores experimental data of photocatalytic asymmetric reactions, including simplified molecular linear input specification (SMILES) data of reactants and corresponding yields (Yield). All required original reaction sample data and their yields are obtained through database query or data export function.
[0060] Optionally, the converting the original reaction sample data into vector fingerprint data using a preset open source toolkit Rdkit, and constructing a sample data set according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data, comprises:
[0061] Using a preset open source toolkit Rdkit, the raw reaction sample data of (X, 2) dimension is converted into vector fingerprint data of (X, 2048) dimension, where X is the total number of raw reaction sample data in the preset reaction database;
[0062] According to the vector fingerprint data of (X, 2048) dimension and the sample yield corresponding to each vector fingerprint data, a sample data set of (X, 2049) dimension is constructed.
[0063] Alternatively, assuming that there are X manually organized reaction and yield data in the laboratory, the product part SMILES of each reaction data and the Yield (yield) of the current reaction must be provided. Then the two columns of data are extracted from the Excel table, and the (X, 2)-dimensional raw data are converted into a new data format of (X, 2049) dimensions based on the open source toolkit Rdkit. Rdkit can convert SMILES into a 2048-dimensional vector, plus the yield, a total of 2049 dimensions, to obtain X rows and 2049 columns of converted data. Each data uses a 2048-dimensional vector fingerprint instead of the original SMILES as the representation of the original data. The change is marked as: "SMILES, Yield (X, 2) -> fp1, fp2, ........., fp2048, Yield (X, 2049)".
[0064] In step 102, the sample data set is randomly sampled multiple times, and each sampling obtains a training test set, which includes a training set and a test set. The training set and the test set are different for each sampling. Through multiple random sampling, it can be ensured that the data in each training test set is diverse.
[0065] Optionally, the random sampling of the sample data set is performed multiple times to obtain multiple training and testing sets, including:
[0066] Repeat the following steps:
[0067] Using a random number generator to generate a random permutation sequence of length Y, processing the sample data set according to the random permutation sequence to obtain a training test set, until multiple random samplings are completed to obtain multiple training test sets;
[0068] Wherein, Y is the total amount of data in the sample data set. The first 80% of the data in each training and test set is the training set, and the last 20% of the data is the test set.
[0069] In the present invention, the X pieces of data with 2049 dimensions are randomly sampled n times to obtain n groups of training sets and test sets with a split ratio of 8:2. Since it is a multiple random sampling, each of the X pieces of data has a certain probability of being assigned to the test set, and the total amount of data in the n sets of data sets is still X pieces, only the splitting methods of the training set and the test set are different. Specifically, for each sampling (i-th time, i=1,2,...,n), the X pieces of data are regarded as an overall data set, and a random number generator is used to generate a random permutation sequence of length X, which contains all integers from 1 to X, but the order is random. According to the set split ratio of the training set and the test set (such as 8:2), the randomly permuted data set is divided into two parts. The first 80% of the data is used as the training set, and the last 20% of the data is used as the test set. The training set and test set obtained by this sampling are recorded for subsequent model training and testing. Repeat the above random sampling process n times, and each time you will get a different training set and test set split, ensuring that in the n samplings, each piece of data has the opportunity to be assigned to the training set or the test set, and the training set and test set obtained each time are different.
[0070] Optionally, the value of n should be reasonably selected based on the actual data volume and computing resources. A value of n that is too large may increase the computing cost, while a value of n that is too small may not fully utilize the data resources. During the random sampling process, the randomness of the random number generator should be ensured to avoid repeated or predictable data segmentation.
[0071] In step 103, for any training test set, a Lasso regression model is trained using the data of its training set. The Lasso regression model (Least Absolute Shrinkage and Selection Operator) is an improved method of linear regression, mainly used for data analysis and feature selection. Its core principle is to add an L1 regularization term (i.e., the sum of the absolute values of the parameters) to the traditional linear regression loss function. In general, Lasso regression is a very useful tool in practice, especially suitable for data sets with a large number of features but limited sample size. Through the regularization method, it not only improves the prediction accuracy of the model, but also helps to identify the most important features. The present invention prevents overfitting by adding an L1 regularization term and facilitates feature selection. The trained Lasso regression model is used to predict the yield of the data in the test set, and the deviation between the prediction result and the actual yield is calculated. If the deviation exceeds a preset threshold (such as 30%), it is considered that the prediction ability of the vector fingerprint data is unqualified. All training test sets are traversed, and the number of times each vector fingerprint data fails in multiple predictions is counted. If the number of times the prediction ability of a certain vector fingerprint data fails exceeds a preset number (such as 90% of the total number of times), it is determined that the corresponding original reaction sample data is the data to be eliminated. Finally, all the data to be eliminated are eliminated from all the original reaction sample data.
[0072] Optionally, for any training test set, determining the prediction capability of the vector fingerprint data according to the yield prediction result of each vector fingerprint data in the test set includes:
[0073] For any training test set, an original yield prediction model is trained according to the training set in the training test set, and each vector fingerprint data in the test set corresponding to the training test set is respectively input into the original yield prediction model to obtain the initial predicted yield corresponding to each vector fingerprint data output by the original yield prediction model;
[0074] Determining a yield deviation value according to the sample yield corresponding to the vector fingerprint data and the initial predicted yield;
[0075] The prediction capability of the vector fingerprint data is determined according to the yield deviation value and a preset deviation value.
[0076] Optionally, for each training test set, the model is first trained using the training set data within it. Here, a Lasso regression model with random initialization parameters is used as the original yield prediction model. The model is trained using the training set data (including vector fingerprint data and corresponding sample yields) so that the model can learn the mapping relationship between the vector fingerprint data and the yield. The trained original yield prediction model is applied to the test set corresponding to the current training test set, that is, each vector fingerprint data in the test set is input into the original yield prediction model respectively, and the initial predicted yield corresponding to each vector fingerprint data output by the original yield prediction model is obtained. According to the sample yield corresponding to the vector fingerprint data (that is, the actual yield measured experimentally) and the initial predicted yield output by the model, the deviation value between the two is calculated.
[0077] Optionally, determining the prediction capability of the vector fingerprint data according to the yield deviation value and the preset deviation value includes:
[0078] In the case where the yield deviation value is greater than a preset deviation value, determining that the prediction capability of the vector fingerprint data is unqualified;
[0079] When the yield deviation value is less than or equal to the preset deviation value, it is determined that the prediction ability of the vector fingerprint data is qualified.
[0080] Optionally, the calculated yield deviation value is compared with a preset deviation value. The preset deviation value is a threshold value used to determine whether the prediction result is accurate enough. If the yield deviation value is greater than the preset deviation value, it is considered that the prediction ability of the vector fingerprint data is poor, that is, there is a large difference between the model's prediction result of the data and the actual result, and the prediction ability of the vector fingerprint data is determined to be unqualified; otherwise, it is considered that the prediction ability of the vector fingerprint data is good, and the prediction ability of the vector fingerprint data is determined to be qualified.
[0081] Optionally, before removing all the data to be removed from all the original reaction sample data to obtain the reaction sample data after removal, the method further includes:
[0082] When it is determined that the number of all data to be eliminated is greater than the preset number, increasing the preset deviation value to re-determine all data to be eliminated;
[0083] The preset number is determined according to the total number of all original reaction sample data and a first preset coefficient.
[0084] Optionally, a preset quantity threshold (set as K) is calculated according to the total quantity of all original reaction sample data (set as M) and a preset first preset coefficient (set as α, 0<α<1). The calculation formula is: K =M * α, the preset number threshold K is used to judge whether the number of data to be eliminated is too much, so as to determine whether the preset deviation value needs to be adjusted. According to the technical solution disclosed in the present invention, through multiple random sampling, Lasso regression model training and testing, the number of times the prediction deviation of each data in multiple models is greater than the preset deviation value is counted, and all training and test sets are traversed. When the number of times the prediction ability of any vector fingerprint data is unqualified exceeds the preset number, the original reaction sample data corresponding to the vector fingerprint data is determined to be the data to be eliminated. When it is determined that the number of all data to be eliminated is greater than the preset number threshold K, it is considered that the current preset deviation value may be too strict, resulting in too much data being identified as outliers, which is not conducive to subsequent model construction. Therefore, the preset deviation value is increased to a new level, and the above-mentioned data cleaning process is re-performed, including random sampling, model training and testing steps, and then all data to be eliminated are re-determined. At this time, the number of all data to be eliminated that is re-determined will be greater than the number of all data to be eliminated that was previously determined.
[0085] Optionally, after dynamically adjusting the preset deviation value and re-determining the data to be eliminated, all the data to be eliminated are eliminated from all the original reaction sample data to obtain the eliminated reaction sample data, and these eliminated reaction sample data are used for subsequent machine learning model training to improve the model's prediction accuracy for yield, which is suitable for small data set scenarios such as photocatalytic asymmetric reactions.
[0086] Optionally, traversing all training test sets and determining that the original reaction sample data corresponding to the vector fingerprint data is data to be removed when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times includes:
[0087] Traverse all training and test sets to obtain the prediction ability of each training and test set corresponding to each vector fingerprint data in the test set;
[0088] For any vector fingerprint data in the test set corresponding to each training test set, count the number of times the prediction ability of the vector fingerprint data is unqualified, and determine the preset number of times according to the total number of times the vector fingerprint data participates in the prediction and the second preset coefficient;
[0089] When the prediction ability of the vector fingerprint data is unqualified for more than the preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the vector fingerprint data in the test set corresponding to all training test sets are traversed to obtain all the data to be eliminated.
[0090] In an optional embodiment, the present invention extracts two columns of information, namely, SMILES of the product part and the corresponding Yield (yield) from X manually sorted photocatalytic asymmetric reaction data obtained from the laboratory, and uses the open source toolkit Rdkit to convert the SMILES into a 2048-dimensional vector, and adds the yield to form a 2049-dimensional data format, that is, each data consists of fp1, fp2, ..., fp2048, Yield composition, random sampling is performed n times on the preprocessed X 2049-dimensional data to obtain n groups of training sets and test sets, with a split ratio of 8:2. For the n groups of training sets and test sets, n Lasso regression models with random initialization parameters are created, and the training set in each group of data is used for model training. For any vector fingerprint data in the test set corresponding to each training test set, the trained model is used to predict the yield, and the deviation between the predicted value and the actual value is calculated. According to the preset deviation threshold, it is judged whether the prediction ability of the vector fingerprint data is qualified, and all training test sets are traversed to count the number of times the prediction ability of each vector fingerprint data is unqualified. For each vector fingerprint data, according to the total number of times it participates in the prediction and the second preset coefficient (such as a ratio value between 0 and 1), the preset times, that is, the upper limit of the number of unqualified times allowed. If the number of times that the prediction ability of any vector fingerprint data is unqualified exceeds the corresponding preset number, the original reaction sample data corresponding to the vector fingerprint data is determined to be the data to be eliminated, and all vector fingerprint data in the test set corresponding to all training test sets are traversed. According to the above evaluation and dynamic threshold setting strategy, all data to be eliminated are obtained. When it is determined that the number of all data to be eliminated is greater than the preset number, the preset deviation value is increased, and the above prediction ability evaluation and dynamic threshold setting steps are re-executed to re-determine all data to be eliminated. Based on the data set after eliminating the abnormal data, the Lasso regression model or other applicable machine learning model is retrained to evaluate the model's fitting ability, such as using the R2 indicator, and the model is further optimized according to the evaluation results. The full name of the R2 indicator is R-squared, which is an indicator to measure the degree of fit of the regression model. In the neural network, R2 is used to evaluate the degree of fit between the network output and the target value. The closer its value is to 1, the better the fit of the network model. Conversely, if the R2 value is close to 0, it indicates that the model fit is very poor.
[0091] In step 104, a preset yield prediction model is trained using the eliminated reaction sample data and the corresponding sample yields. The preset yield prediction model can be any machine learning model suitable for regression problems, such as linear regression, support vector regression, random forest, etc. After the model training is completed, the vector fingerprint of the target reaction data is input into the preset yield prediction model. The preset yield prediction model calculates the target yield based on the input target reaction data and outputs the target yield. The close relationship between each step in the present invention together constitutes a complete yield prediction method. Through steps such as data conversion, multiple random sampling, outlier elimination and model training, the present invention can significantly improve the accuracy of photocatalytic asymmetric reaction yield prediction.
[0092] Aiming at the scenario where the amount of photochemical real reaction data is small, the present invention uses the preset open source toolkit Rdkit, and the original reaction sample data SMILES is efficiently converted into vector fingerprint data, which not only retains the key information of the chemical structure, but also makes the data more suitable for subsequent machine learning processing. A prediction ability evaluation mechanism is introduced to determine its prediction ability according to the yield prediction result of the vector fingerprint data, and unqualified data is eliminated accordingly to reduce the impact of noise data on model training. It can automatically clean out outlier data based on a small amount of photocatalytic asymmetric reaction data already available in the laboratory, and use the reaction sample data after elimination to train a preset yield prediction model, thereby ensuring the accuracy and reliability of the model input data and improving the prediction accuracy of the model;
[0093] The present invention can clean the data before machine learning modeling for a small number of data sets (hundreds). When the number of all data to be eliminated is greater than the preset number, the preset deviation value is increased, and all data to be eliminated are re-determined to ensure that the number of all data to be eliminated for model training is not too low. By flexibly setting the preset deviation value, it can be adjusted according to actual conditions to adapt to different data sets and prediction needs.
[0094] Figure 2 This is the second flow chart of the yield prediction method provided by the present invention, such as Figure 2As shown, the present invention first obtains X pieces of laboratory raw data, each piece of data contains SMILES and yield Yield, pre-processes the raw data, generates a 2048-bit Morgan fingerprint vector, and the processed data format is X records, each record contains 2048 fingerprint features (fp1, fp2, ..., fp2048) and Yield, randomly samples the processed data set n times, generates a new training set and test set for each sampling, uses the Lasso regression algorithm to perform model training on the training set of each data set, obtains n different Lasso models (Lasso model 1, Lasso model 2, ..., Lasso model n), uses the test set corresponding to each Lasso model to perform prediction, obtains the yield prediction value, calculates the deviation between the predicted value and the true value, and for each sample, counts the number of times its prediction deviation exceeds a certain threshold in all n models. If a sample has a large prediction deviation in more than n90% of the models, the sample is considered to be an outlier. For the sample considered to be an outlier, it is removed as an outlier, and for other samples, it is retained for subsequent model training or other analysis.
[0095] The present invention creates n Lasso regression models with random initialization parameters for n groups of training sets and test sets, and uses the training set in each group of data to perform model training, then uses the trained model to perform yield prediction on the test set in the group of data, and counts which samples in the test set have true yield values that differ from the model predicted values by more than 30%. For example, reaction data No. 1 in X pieces of data is randomly assigned to the test set, and the true yield value measured by experiment is 80%, but the predicted yield given by the model is 40%, and the yield deviation is greater than 30%, then it is recorded that the data No. 1 performs poorly in the prediction result of 1 / n.
[0096] Finally, the test results of the n models in the test set are summarized, and the number of prediction deviations > 30% (large deviations are considered poor data) for each of the X data in the test set and in the n models is counted. If more than 90% (n*90%) of the prediction results of a certain data in the n models are poor, for example, a certain data is assigned to the test set in 300 modelings and the prediction performance is not good in at least 270 times, then the current data will be determined as outlier data, which is not suitable for subsequent regression model training and will be eliminated. Compared with directly taking X original data for model training, the present invention is based on the regression model trained based on the data set with the abnormal data eliminated, and its fitting ability is significantly improved from 0 to 0.42. The method for cleaning the photocatalytic asymmetric reaction data in the case of only a small data set can significantly improve the prediction accuracy of the model for the yield.
[0097] Figure 3It is a structural schematic diagram of the yield prediction device provided by the present invention, and the yield prediction device includes a construction unit 1, which is used to convert each original reaction sample data in the photocatalytic asymmetric reaction into vector fingerprint data using a preset open source toolkit Rdkit, and construct a sample data set according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data. The working principle of the construction unit 1 can refer to the aforementioned step 101 and will not be repeated here.
[0098] The yield prediction device also includes a sampling unit 2, which is used to perform multiple random sampling on the sample data set to obtain multiple training test sets, wherein the training test set includes a training set and a test set, and the training set and the test set in each training test set are different. The working principle of the sampling unit 2 can refer to the aforementioned step 102 and will not be repeated here.
[0099] The yield prediction device also includes a determination unit 3, which is used to determine the prediction ability of the vector fingerprint data for any training test set according to the yield prediction results of each vector fingerprint data in the test set, traverse all training test sets, and when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, determine the original reaction sample data corresponding to the vector fingerprint data as data to be eliminated, eliminate all data to be eliminated from all original reaction sample data, and obtain reaction sample data after elimination. The working principle of the determination unit 3 can refer to the aforementioned step 103 and will not be repeated here.
[0100] The yield prediction device also includes an input unit 4, which is used to input target reaction data into a preset yield prediction model to obtain the target yield output by the preset yield prediction model. The preset yield prediction model is determined after training based on all post-elimination reaction sample data and the sample yield corresponding to each post-elimination reaction sample data. The working principle of the input unit 4 can refer to the aforementioned step 104 and will not be repeated here.
[0101] Aiming at the scenario where the amount of photochemical real reaction data is small, the present invention uses the preset open source toolkit Rdkit, and the original reaction sample data SMILES is efficiently converted into vector fingerprint data, which not only retains the key information of the chemical structure, but also makes the data more suitable for subsequent machine learning processing. A prediction ability evaluation mechanism is introduced to determine its prediction ability according to the yield prediction result of the vector fingerprint data, and unqualified data is eliminated accordingly to reduce the impact of noise data on model training. It can automatically clean out outlier data based on a small amount of photocatalytic asymmetric reaction data already available in the laboratory, and use the reaction sample data after elimination to train a preset yield prediction model, thereby ensuring the accuracy and reliability of the model input data and improving the prediction accuracy of the model;
[0102] The present invention can clean the data before machine learning modeling of a small number of data sets. When the number of all data to be eliminated is greater than the preset number, the preset deviation value is increased, and all data to be eliminated are re-determined to ensure that the number of all data to be eliminated for model training is not too low. By flexibly setting the preset deviation value, it can be adjusted according to actual conditions to adapt to different data sets and prediction needs.
[0103] Figure 4 Schematic diagram of the structure of the electronic device provided by the present invention. Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430 and a communications bus 440, wherein the processor 410, the communications interface 420 and the memory 430 communicate with each other via the communications bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the yield prediction method, which includes: for each original reaction sample data in the photocatalytic asymmetric reaction, using a preset open source toolkit Rdkit to convert the original reaction sample data into vector fingerprint data, and constructing a sample data set according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data; performing multiple random sampling on the sample data set to obtain multiple training test sets, wherein the training test set includes a training set and a test set, and the training set and the test set in each training test set are different; for any training test set, according to each in the test set The yield prediction result of the vector fingerprint data determines the prediction ability of the vector fingerprint data, traverses all training test sets, and when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, determines that the original reaction sample data corresponding to the vector fingerprint data is the data to be eliminated, eliminates all the data to be eliminated from all the original reaction sample data, and obtains the eliminated reaction sample data; inputs the target reaction data into the preset yield prediction model to obtain the target yield output by the preset yield prediction model, and the preset yield prediction model is determined after training based on all the eliminated reaction sample data and the sample yield corresponding to each eliminated reaction sample data.
[0104] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0105] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a yield prediction method provided by the above methods, the method comprising: for each original reaction sample data in the photocatalytic asymmetric reaction, using a preset open source toolkit Rdkit to convert the original reaction sample data into vector fingerprint data, and constructing a sample data set according to all vector fingerprint data and the sample yield corresponding to each vector fingerprint data; performing multiple random sampling on the sample data set to obtain multiple training test sets, wherein the training test set includes a training set and a test set, and each training test set The training set and the test set are different; for any training test set, the prediction ability of the vector fingerprint data is determined according to the yield prediction result of each vector fingerprint data in the test set, and all training test sets are traversed. When the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the data to be eliminated are eliminated from all the original reaction sample data to obtain the eliminated reaction sample data; the target reaction data is input into the preset yield prediction model to obtain the target yield output by the preset yield prediction model, and the preset yield prediction model is determined after training based on all the eliminated reaction sample data and the sample yield corresponding to each eliminated reaction sample data.
[0106] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the processor executes the yield prediction method provided by the above methods, the method comprising: for each original reaction sample data in the photocatalytic asymmetric reaction, using a preset open source toolkit Rdkit to convert the original reaction sample data into vector fingerprint data, and constructing a sample data set according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data; performing multiple random sampling on the sample data set to obtain multiple training test sets, wherein the training test set includes a training set and a test set, and the training set and the test set in each training test set are different; for For any training test set, the prediction ability of the vector fingerprint data is determined according to the yield prediction result of each vector fingerprint data in the test set, and all training test sets are traversed. When the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the data to be eliminated are eliminated from all the original reaction sample data to obtain the eliminated reaction sample data; the target reaction data is input into the preset yield prediction model to obtain the target yield output by the preset yield prediction model, and the preset yield prediction model is determined after training based on all the eliminated reaction sample data and the sample yield corresponding to each eliminated reaction sample data.
[0107] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A yield prediction method, characterized in that: include: For each original reaction sample data in the photocatalytic asymmetric reaction, the original reaction sample data is converted into vector fingerprint data using a preset open source toolkit Rdkit, and a sample data set is constructed according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data, wherein the original reaction sample data is simplified molecular linear input specification data; Performing multiple random sampling on the sample data set to obtain multiple training and testing sets, wherein the training and testing sets include a training set and a testing set, and the training set and the testing set in each training and testing set are different; For any training test set, the prediction ability of the vector fingerprint data is determined according to the yield prediction result of each vector fingerprint data in the test set, and all training test sets are traversed. When the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the data to be eliminated are eliminated from all the original reaction sample data to obtain the reaction sample data after elimination; Inputting the target reaction data into a preset yield prediction model to obtain the target yield output by the preset yield prediction model, wherein the preset yield prediction model is determined after training based on all the eliminated reaction sample data and the sample yield corresponding to each eliminated reaction sample data; The traversing all training test sets and determining the original reaction sample data corresponding to the vector fingerprint data as data to be eliminated when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times includes: Traverse all training and test sets to obtain the prediction ability of each training and test set corresponding to each vector fingerprint data in the test set; For any vector fingerprint data in the test set corresponding to each training test set, count the number of times the prediction ability of the vector fingerprint data is unqualified, and determine the preset number of times according to the total number of times the vector fingerprint data participates in the prediction and the second preset coefficient; When the prediction ability of the vector fingerprint data is unqualified for more than the preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the vector fingerprint data in the test set corresponding to all training test sets are traversed to obtain all the data to be eliminated.
2. The yield prediction method according to claim 1, characterized in that: Before converting the original reaction sample data into vector fingerprint data using the preset open source toolkit Rdkit, the method further includes: All original reaction sample data and the sample yield corresponding to each original reaction sample data are obtained from the preset reaction database.
3. The yield prediction method according to claim 2, characterized in that: The method of converting the original reaction sample data into vector fingerprint data by using a preset open source toolkit Rdkit, and constructing a sample data set according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data, includes: Using a preset open source toolkit Rdkit, the raw reaction sample data of (X, 2) dimension is converted into vector fingerprint data of (X, 2048) dimension, where X is the total number of raw reaction sample data in the preset reaction database; According to the vector fingerprint data of (X, 2048) dimension and the sample yield corresponding to each vector fingerprint data, a sample data set of (X, 2049) dimension is constructed.
4. The yield prediction method according to claim 1, characterized in that: For any training test set, determining the prediction capability of the vector fingerprint data according to the yield prediction result of each vector fingerprint data in the test set includes: For any training test set, an original yield prediction model is trained according to the training set in the training test set, and each vector fingerprint data in the test set corresponding to the training test set is respectively input into the original yield prediction model to obtain the initial predicted yield corresponding to each vector fingerprint data output by the original yield prediction model; Determining a yield deviation value according to the sample yield corresponding to the vector fingerprint data and the initial predicted yield; Determining the prediction capability of the vector fingerprint data according to the yield deviation value and the preset deviation value; The original yield prediction model is a Lasso regression model.
5. The yield prediction method according to claim 4, characterized in that: The step of determining the prediction capability of the vector fingerprint data according to the yield deviation value and the preset deviation value includes: In the case where the yield deviation value is greater than a preset deviation value, determining that the prediction capability of the vector fingerprint data is unqualified; When the yield deviation value is less than or equal to the preset deviation value, it is determined that the prediction ability of the vector fingerprint data is qualified.
6. The yield prediction method according to claim 4 or 5, characterized in that: Before removing all the data to be removed from all the original reaction sample data to obtain the reaction sample data after removal, the method further includes: When it is determined that the number of all data to be eliminated is greater than the preset number, increasing the preset deviation value to re-determine all data to be eliminated; The preset number is determined according to the total number of all original reaction sample data and a first preset coefficient.
7. The yield prediction method according to claim 1, characterized in that: The sample data set is randomly sampled multiple times to obtain multiple training and testing sets, including: Repeat the following steps: Using a random number generator to generate a random permutation sequence of length Y, processing the sample data set according to the random permutation sequence to obtain a training test set, until multiple random samplings are completed to obtain multiple training test sets; Wherein, Y is the total amount of data in the sample data set. The first 80% of the data in each training and test set is the training set, and the last 20% of the data is the test set.
8. A yield prediction device, characterized in that: include: A construction unit is used to convert each original reaction sample data in the photocatalytic asymmetric reaction into vector fingerprint data using a preset open source toolkit Rdkit, and construct a sample data set according to all the vector fingerprint data and the sample yield corresponding to each vector fingerprint data, wherein the original reaction sample data is simplified molecular linear input specification data; A sampling unit, used for performing multiple random sampling on the sample data set to obtain multiple training and testing sets, wherein the training and testing sets include a training set and a testing set, and the training set and the testing set in each training and testing set are different; A determination unit is used to determine the prediction ability of the vector fingerprint data according to the yield prediction result of each vector fingerprint data in the test set for any training test set, traverse all training test sets, and when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times, determine the original reaction sample data corresponding to the vector fingerprint data as the data to be eliminated, eliminate all the data to be eliminated from all the original reaction sample data, and obtain the reaction sample data after elimination; An input unit, used to input target reaction data into a preset yield prediction model to obtain a target yield output by the preset yield prediction model, wherein the preset yield prediction model is determined after training based on all eliminated reaction sample data and the sample yield corresponding to each eliminated reaction sample data; The traversing all training test sets and determining the original reaction sample data corresponding to the vector fingerprint data as data to be eliminated when the prediction ability of any vector fingerprint data is unqualified for more than a preset number of times includes: Traverse all training and test sets to obtain the prediction ability of each training and test set corresponding to each vector fingerprint data in the test set; For any vector fingerprint data in the test set corresponding to each training test set, count the number of times the prediction ability of the vector fingerprint data is unqualified, and determine the preset number of times according to the total number of times the vector fingerprint data participates in the prediction and the second preset coefficient; When the prediction ability of the vector fingerprint data is unqualified for more than the preset number of times, the original reaction sample data corresponding to the vector fingerprint data is determined as the data to be eliminated, and all the vector fingerprint data in the test set corresponding to all training test sets are traversed to obtain all the data to be eliminated.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the yield prediction method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Artificial intelligence (AI) method for cleaning data to train (AI) model
CN115699208A
Intelligent system evaluation method based on feedback feature extraction and causal inversion identification
CN118821874A