Optimization of reaction conditions in any chemical reaction is necessary to obtain high product yield, selectivity, and/or the desired properties. The optimization process is generally performed for each reaction system because experimental results are highly sensitive to reaction conditions. In addition, optimization attempts require considerable time, labor, and costs and depend on the chemist’s experiences and intuition. Thus, development of rational and efficient optimization schemes for reaction conditions is desired to determine appropriate conditions rapidly.
So far, several optimization schemes have been proposed from two different perspectives. The first approach is the analysis of more than thousands of experimental data points. In recent studies, for example, the experimental data extracted from a reaction database^{1} or obtained using special experimental equipment^{2}^{–}^{4} were investigated. The second approach is the development of algorithmassisted optimization schemes, which suggest reaction conditions for better results, with a small number of experiments.^{5}^{–}^{22}
The optimization scheme for a small number of experiments requires careful consideration of different types of reaction conditions, which include continuous and discrete (discontinuous) variables. Various optimizations have been performed for reaction systems consisting of only continuous conditions^{5}^{–}^{10} or only discrete ones.^{11}^{–}^{13} For example, the schemes for flow and microfluidic reactor systems have achieved automatic and effective optimization^{14}^{–}^{19} through realtime monitoring of the reactions and continuous changes of the reaction conditions. However, there are only a few studies on reaction conditions that include both continuous and discrete conditions.^{20}^{–}^{22} These optimizations have been performed in flow reactors with up to three continuous and discrete variables.
This study attempted to investigate virtual reaction condition optimization with a small number of batch experiments and highdimensional conditions. Here, we focused on a synthetic reaction of tetrasilabicyclo[1.1.0]but1(3)ene (SiBBE), shown in Scheme 1.^{23} The conditions include five continuous and four discrete variables. First, we constructed a predictive function, which can predict product yields from reaction conditions using machine learning. Subsequently, we analyzed the function and discussed important factors contributing to a high product yield. Finally, we performed virtual optimization of the reaction conditions using the proposed scheme.
Machine learning was performed using 57 experimental data points. The experiments with nine reaction conditions were conducted: the scale of reactants, solvents, concentration of reactants, temperature, reaction time, reductants, equivalent mass of reductants, stirring method, and product extraction method. Here, the stirring method refers to the use of nichrome wires in a stirring process, which scratches the surface of dispersed Na in the solvent. Detailed information about the reaction conditions and the corresponding product yields is provided in Supporting Information.
Before machine learning, data preprocessing was performed based on a usual method in the field of data science. The reaction conditions were divided into continuous and discrete data. The continuous data included the scale of reactants, concentration of reactants, temperature, reaction time, and equivalent mass of reductants. The discrete data included the solvents, reductants used, stirring method, and product extraction method. The discrete data in each reaction condition were transformed into binary values: zero or one. For example, data about the solvent were converted into fourdimensional binary values because the experiments used four solvents: tetrahydrofuran (THF), diethyl ether (Et_{2}O), toluene, and hexane. Each condition was scaled to have a mean value of zero and a deviation value of one.
Using the preprocessed data, machine learning was performed to investigate whether the product yields can be predicted from the reaction conditions. Twenty regression methods were adopted to assess the accuracy. The mean absolute errors (MAEs) and correlation coefficients between the experimental and predicted product yields were used as the evaluation metrics. The accuracy was estimated through double crossvalidation to avoid an overestimation of the performance. In the double crossvalidation, the data were divided into three sets: test, validation, and training sets. The accuracy of the prediction was evaluated using only the test set. The hyperparameters for regression methods were determined using the validation and training sets to minimize the MAE for the validation sets. The test set was generated using the leaveoneout (LOO) method. The validation and training sets were constructed using fivefold crossvalidation for each LOO process.
Table 1 summarizes the MAEs and correlation coefficients for each regression method. We adopted 10 linear and 10 nonlinear regression methods. The linear regression methods include ordinal linear, least absolute shrinkage and selection operator (LASSO), ridge, elastic net, Huber, partial least squares (PLS), Bayesian ridge, automatic relevance determination (ARD) regressions, kernel ridge regression (KRR) with linear kernel, and support vector regression (SVR) with linear kernel. The nonlinear regression methods include Gaussian process regression, KRR with polynomial, radial basis function (rbf), and sigmoid kernel, SVR with polynomial, rbf, and sigmoid kernel, decision tree regression, random forest regression, and AdaBoost decision tree regression. The linear methods showed MAEs in the range 6.61 to 8.11 and correlation coefficients in the range 0.53 to 0.70. The nonlinear ones showed MAEs in the range 6.52 to 9.26 and correlation coefficients in the range 0.32 to 0.67. The linear regression methods provide the same or better results in terms of accuracy as compared with the nonlinear ones. This indicates that the relationships between the reaction conditions and product yields are approximately linear for the present reaction data. This also suggests that the use of nonlinear regression for the small number of data points in a large number of variables tends to cause overfitting. The KRR with linear kernel showed the highest correlation coefficient, 0.70, with an MAE of 6.61%. This indicates that the model can provide qualitative predictions of the product yields.
 Table 1. Statistical MAEs and correlation coefficients in 10 linear and 10 nonlinear regression methods. 

Table 1. Statistical MAEs and correlation coefficients in 10 linear and 10 nonlinear regression methods.
Type  Method  MAE %  Correlation coefficient 
Linear  Linear  7.47  0.61 
LASSO  6.93  0.65 
Ridge  7.42  0.62 
Elastic net  6.88  0.66 
Huber  7.13  0.64 
PLS  7.05  0.65 
Bayesian ridge  6.87  0.66 
ARD  7.28  0.61 
KRR (linear kernel)  6.61  0.70 
SVR (linear kernel)  8.11  0.53 
Nonlinear  Gaussian process  6.85  0.67 
KRR (polynomial kernel)  7.21  0.61 
KRR (rbf kernel)  7.79  0.52 
KRR (sigmoid kernel)  7.05  0.61 
SVR (polynomial kernel)  8.83  0.32 
SVR (rbf kernel)  6.90  0.66 
SVR (sigmoid kernel)  6.52  0.67 
Decision tree  9.26  0.34 
Random forest  7.59  0.56 
AdaBoost decision tree  7.67  0.56 
Linear correlations between the reaction conditions and product yields can be analyzed using the coefficients in linear regressions. Here, we focused on LASSO because the scheme has an advantage in that it can force coefficients with small contributions to the product yields to be zero. Table 2 shows the coefficient for each condition. The positive and negative signs of the coefficients indicate positive and negative contributions to the product yields, respectively. From the results, 10 reaction conditions have nonzero values, which indicate major contributions to the product yields. The other six reaction conditions have zero values, which indicate negligible contributions. The results suggested that smaller scale, stirring with nichrome wire, longer reaction time, and lower temperature improve the product yields, as can be expected. For reductants and solvents, only the uses of prepared Na and hexane provide positive contributions to the product yields. The coefficients for the other reductants and solvents have negative or zero values. The other reaction conditions such as the concentration of reactant, equivalent mass of reductants, and extraction method have only slight contributions to the product yields. This analysis can be useful for a wide range of reaction conditions including discrete variables.
 Table 2. Regression coefficients in LASSO. Reaction conditions are arranged in the descending order of the absolute values. 

Table 2. Regression coefficients in LASSO. Reaction conditions are arranged in the descending order of the absolute values.
Condition  Coefficient 
Scale  −0.46 
Stirring with nichrome wire  0.38 
Time  0.32 
Temperature  −0.30 
KC_{8} (Reductant)  −0.30 
NaK_{2} (Reductant)  −0.24 
Na (Reductant, prepared)  0.18 
Hexane (Solvent)  0.13 
Et_{2}O (Solvent)  −0.09 
LiNaph (Reductant)  −0.09 
Concentration of reactants  0.00 
THF (Solvent)  0.00 
Na (Reductant, commercially available)  0.00 
Hot toluene (Extraction)  0.00 
Equivalent mass of reductants  0.00 
Soxhlets (Extraction)  0.00 
Finally, we performed a virtual reaction condition optimization simulation. Scheme 2 shows the algorithms in detail. The algorithms aimed to maximize an objective value corresponding to a given reaction condition. Here, the objective value was defined as 2log(y) + log(m), where y and m represent yields and masses of the product, i.e. SiBBE, respectively. Here, m is defined as the product of the reactant scale and y. If we adopt y as an objective value, reactions in smaller scale become favorable. If we adopt m as an objective value, largescale reactions can increase the masses but decrease the yields. Experimental chemists attempted to determine a reaction condition with high yield and large mass simultaneously. The best reaction condition determined by the experimental chemists of the authors was the 50th one.^{23} The objective function was designed to maximize the value at the reaction condition. The behaviors of simulations with other objective functions are described in Supporting Information.
We performed one random simulation and three optimization simulations based on machine learning. The random method, termed Method R, iteratively selected an experimental condition in a random manner and evaluated a corresponding objective value. The other three methods for the optimization were examined because the efficiency of the simulation strongly depends on the choice of initial data. The first scheme, termed Method A, adopted five initial experimental data points, which are the same as the initial ones applied in experiments. A regression function was constructed to predict the corresponding product yields from the given reaction conditions. The function was applied to the remaining 52 reaction conditions to predict the product yields y and masses m. Subsequently, objective values, 2log(y) + log(m), were calculated. Next, a reaction condition that would provide the largest objective value in the prediction was chosen and added to the initial learning data. This process indicates a virtual determination of the subsequent experiment. Finally, the learning procedure was iteratively performed until all the data were learned. In this procedure, KRR with linear kernel was adopted as the machine learning method. The hyperparameter was determined through LOO for each iteration.
In the second scheme, termed Method B, five initial data points were randomly selected from 57 experimental data points. The third scheme, termed Method C, adopted five distant data points from 57 experimental data points in terms of the distances of reaction conditions. The procedure for the selection of five distant data points is explained as follows. First, 1,000 virtual reaction conditions were randomly generated in uniform distributions with a range of experimental conditions. Then, the data were classified into five clusters using the kmeans algorithm. Five centroids for the clusters were determined. Finally, five experimental data points with the closest distances from the centroids were chosen as the initial data. The performances of Methods B, C, and R were estimated from the average of results in 1,000 virtual simulations because the results depend on the randomness of the initial selection.
Figure 1 shows the number of experiments required to obtain a target condition that provides the highest objective value. The results of Experiment and Method A are represented by black solid and dashed lines, respectively. The results of Methods B, C, and R are expressed by a histogram of 1,000 simulations. The vertical axis shows the frequencies for the histogram. The average performances of Methods B, C, and R are represented by red, blue, and gray dotted lines, respectively. The resulting numbers of experiments in the simulations were 16 for Method A, 17.1, 11.7, and 22.8 for Methods B, C, and R on average, respectively. Methods A, B, and C predicted the target condition more efficiently than Experiment, which required 50 experiments and Method R. Methods A and B showed similar efficiency. Method C showed better performance. These results indicate that the present scheme is promising for a rational optimization of reaction conditions. In addition, a uniform scatter in data space for the initial data is important for effective optimization.
In this study, virtual reaction condition optimization was performed based on machine learning for highdimensional continuous and discrete conditions in a small number of experiments. The virtual simulation showed reasonable performances for reducing the number of trials in the experiments. The results indicate that linear regression and a simple optimization scheme are effective for highdimensional reaction condition optimization both with continuous and discrete data. A good performance was obtained owing to the relatively high linear relationship between the reaction conditions and product yields in the present experimental data.
To apply this scheme with high efficiency, the following points should be considered. First, chemists should set reaction conditions properly and examine their ranges to be optimized before starting optimization experiments. Second, experimental data of the same quality, including little noise produced by equipment problems or human errors, are required because the robustness of machine learning considerably decreases with the inclusion of outliers. Moreover, failed experiments should be included in learning data. Here, the failed data mean undesired data for chemists, e.g. reaction conditions giving zero or low yield in this study. All the experimental data are mathematically useful for machine learning, as pointed out in ref 24. If the scheme is applied appropriately in suitable systems, which satisfy the requirements above, rational optimization might be performed sufficiently.
The author M.F. is supported by a GrantinAid for Japan Society for the Promotion of Science Research Fellow. The author J.S. is grateful to the specific project investigation in PRESTO Program “Advanced Materials Informatics through Comprehensive Integration among Theoretical, Experimental, Computational and DataCentric Sciences” of Japan Science and Technology Agency.
M. Fujinami
J. Seino
H. Nakai
T. Nukazawa
S. Ishida
T. Iwamoto
1)  H. Gao, T. J. Struble, C. W. Coley, Y. Wang, W. H. Green, K. F. Jensen, ACS Cent. Sci. 2018, 4, 1465. Crossref, Medline, CAS 
2)  J. M. Granda, L. Donina, V. Dragone, D.L. Long, L. Cronin, Nature 2018, 559, 377. Crossref, Medline, CAS 
3)  D. Caramelli, D. Salley, A. Henson, G. A. Camarasa, S. Sharabi, G. Keenan, L. Cronin, Nat. Commun. 2018, 9, 3406. Crossref, Medline 
4)  D. T. Ahneman, J. G. Estrada, S. Lin, S. D. Dreher, A. G. Doyle, Science 2018, 360, 186. Crossref, Medline, CAS 
5)  K. W. Moore, A. Pechen, X.J. Feng, J. Dominy, V. J. Beltrani, H. Rabitz, Phys. Chem. Chem. Phys. 2011, 13, 10048. Crossref, Medline, CAS 
6)  K. M. Tibbetts, X.J. Feng, H. Rabitz, Phys. Chem. Chem. Phys. 2017, 19, 4266. Crossref, Medline, CAS 
7)  L.H. Schilling, F. Niekiel, N. Stock, B. Hartke, ChemPlusChem 2014, 79, 863. Crossref, CAS 
8)  C. Houben, N. Peremezhney, A. Zubov, J. Kosek, A. A. Lapkin, Org. Process Res. Dev. 2015, 19, 1049. Crossref, Medline, CAS 
9)  Z. Zhou, X. Li, R. N. Zare, ACS Cent. Sci. 2017, 3, 1337. Crossref, Medline, CAS 
10)  B. Cao, L. A. Adutwum, A. O. Oliynyk, E. J. Luber, B. C. Olsen, A. Mar, J. M. Buriak, ACS Nano 2018, 12, 7434. Crossref, Medline, CAS 
11)  J. E. Kreutz, A. Shukhaev, W. Du, S. Druskin, O. Daugulis, R. F. Ismagilov, J. Am. Chem. Soc. 2010, 132, 3128. Crossref, Medline, CAS 
12)  K. Omata, Ind. Eng. Chem. Res. 2011, 50, 10948. Crossref, CAS 
13)  K. W. Moore Tibbetts, R. Li, I. Pelczer, H. Rabitz, Chem. Phys. Lett. 2013, 572, 1. Crossref, CAS 
14)  C. Houben, A. A. Lapkin, Curr. Opin. Chem. Eng. 2015, 9, 1. Crossref 
15)  S. V. Ley, D. E. Fitzpatrick, R. J. Ingham, R. M. Myers, Angew. Chem., Int. Ed. 2015, 54, 3449. Crossref, Medline, CAS 
16)  V. Sans, L. Cronin, Chem. Soc. Rev. 2016, 45, 2032. Crossref, Medline, CAS 
17)  A. B. Henson, P. S. Gromski, L. Cronin, ACS Cent. Sci. 2018, 4, 793. Crossref, Medline, CAS 
18)  A. Echtermeyer, Y. Amar, J. Zakrzewski, A. Lapkin, Beilstein J. Org. Chem. 2017, 13, 150. Crossref, Medline, CAS 
19)  A. M. Schweidtmann, A. D. Clayton, N. Holmes, E. Bradford, R. A. Bourne, A. A. Lapkin, Chem. Eng. J. 2018, 352, 277. Crossref, CAS 
20)  B. J. Reizman, Y.M. Wang, S. L. Buchwald, K. F. Jensen, React. Chem. Eng. 2016, 1, 658. Crossref, Medline, CAS 
21)  H.W. Hsieh, C. W. Coley, L. M. Baumgartner, K. F. Jensen, R. I. Robinson, Org. Process Res. Dev. 2018, 22, 542. Crossref, CAS 
22)  L. M. Baumgartner, C. W. Coley, B. J. Reizman, K. W. Gao, K. F. Jensen, React. Chem. Eng. 2018, 3, 301. Crossref, CAS 
23)  T. Nukazawa, T. Kosai, S. Honda, S. Ishida, T. Iwamoto, Dalton Trans. 2019, doi:10.1039/c9dt01627a. Crossref, Medline 
24)  P. Raccuglia, K. C. Elbert, P. D. F. Adler, C. Falk, M. B. Wenny, A. Mollo, M. Zeller, S. A. Friedler, J. Schrier, A. J. Norquist, Nature 2016, 533, 73. Crossref, Medline, CAS 