introvoyz041/EChem-Explorations huggingface dataset:
You are an expert in coding and you always write code in one single whole Python code block so that your code can be copied and pasted into a Jupyter Notebook directly to execute. Your task is to help a chemist write an ML program to train a few models for reactivity prediction. The chemist has a list of compounds in "echem_train.xlsx" in the same folder, and the first 10 rows look like this :

"
CAS	Canonical SMILES	Reactivity	Oxidation Site
2049-96-9	CCCCCOC(=O)c1ccccc1	1	2,3
98-51-1	Cc1ccc(C(C)(C)C)cc1	1	1
870259-02-2	C#Cc1cc(C#C)c2ccc3c(C#C)cc(C#C)c4ccc1c2c43	0	-1
121-69-7	CN(C)c1ccccc1	0	-1
82-38-2	CNc1cccc2c1C(=O)c1ccccc1C2=O	0	-1
1209228-43-2	CCCCOc1ccc(CC)cc1	1	10
2459764-19-1	CCc1ccc(CCNC(=O)C2CC(F)(F)C2)cc1	1	2,7
853-23-6	CC(=O)OC1CCC2(C)C(=CCC3C4CCC(=O)C4(C)CCC32)C1	1	12
91-17-8	C1CCC2CCCCC2C1	1	4,9
6553-83-9	CCCCCOC(=O)C1CCCCC1	1	11,12,13

"

where the reactivity can be 1 or 0.

The goal of the ML model is to predict, based on a given SMILES string of a chemical, use its fingerprint to predict whether this compound will react (1) or will not react (0).

Please propose 5 ML models suitable for this case, and do 5-fold cross-validation for each model. 

For the trained model, there is a file called "echem_test.xlsx" with the same layout as the train file, you can use it to evaluate your model performance.

At the end, print out the accuracy performance of each model under cross validation and test set. For example: 
"RandomForestClassifier: Cross-validation accuracy: 0.924 
RandomForestClassifier: Test set accuracy: 0.930

SVC: Cross-validation accuracy: 0.915
SVC: Test set accuracy: 0.957
"
You are an expert in coding and chemistry, and you are designing an experiment with a synthetic chemist to write an active machine learning program in Python to improve the yield of an electrochemical C-H bond oxidation. The same substrate compound will be subjected to different concentrations, mediator types and equivalents, and different electrolytes at 1 eq, with the option of adding a co-solvent. The product will be analyzed to determine if the specific C-H bond is oxidized to C-OH or C=O.

The search space for this optimization has been previously determined and is as follows:


```
Substrate Concentration 0.025 M, 0.05 M, 0.075 M, 0.1M, 0.125M

Mediator eq. 0, 0.25, 0.5, 0.75, 1

Mediator type NHPI, TCNHPI, QD, DABCO, TEMPO

Electrolyte type LiClO4, LiOTf , Bu4NClO4, Et4NBF4, Bu4NPF6

Co solvent HFIP 0, 1

``` 
please write code to generate a csv with the entire search space and each row should be a unique combination of synthesis parameters. The first 5 columns will be these parameters. 

Once you generate the reaction scope, now you can move to the next step: initialization, which gives the chemist 5 conditions to start with by randomly picking 5 conditions. To do this, you create a new csv file called "echem_reaction_opt_round0.csv" with the same 5 columns, then you add a column called "Yield" and assign "PENDING" to all conditions, as we have not yet started to run the actual reactions. The last column should be called "Priority", which suggests the past/next experiments. For the completed experiment, the number is -1, for the suggested experiment, the number is 1 and for the rest, it is 0. This csv should have exact same number of rows as for the search space csv. Since right now we have not yet started, the priority is 0 for all experiments at the beginning. Then you randomly select 5 initial reaction conditions, to which you assign priority 1. Finally, you sort all rows based on priority, so that the "1" comes first, then 0. If possible, make sure you write all your code in one code block so that I can copy and paste it to Jupyter Notebook to execute directly. You do not need to have further explanation on the codes or other instructions.
Now, I have completed the first 5 reactions in the lab, the observed yields are "6, 5, 5, 8, 0" for suggested reactions 1 to 5. Please write the code to help me suggest the next 5 experiments for me. To do this, you need two functions:

First, you should update the yield from the previous csv. You can write a function call "update_yield" which takes a csv, row number, and yield as input and then overwrites the csv by changing the pending yield for priority 1 conditions to observed yields.

Then, to get the next 5 experiments, you should write a function called "reaction_optimization", every time it will take "echem_reaction_opt_roundxxx.csv" as input, verify that all "priority 1" experiments have all filled with observed yield values, and assign their priority to -1 as these experiments are now completed, then suggest 5 more experiments using the "Optimizer" class from skopt with the gaussian process as an estimator and expected improvement as function to tell and ask for next 5 points, remember the search space can only come from the priority 0 experiments in the csv since these are the experiments we have not yet conducted, while those "-1" experiments serve as your data points for optimization. After the optimizer suggests 5 conditions, make a new copy of csv with round n+1 in its name (e.g. "echem_reaction_opt_round1.csv" if the previous is round0; "echem_reaction_opt_round5.csv" if the previous is round4), match the suggested condition with the row number and change their priority from 0 to 1, and sort by priority so that the suggested 5 reactions come first (priority 1), the pending reactions next (priority 0), and the last rows are the 5 completed reactions (-1). Make sure the suggested experiments are unique and will not overlap with the completed ones (in other words, the suggestion can not be the same row with priority -1), and ensure all synthesis parameters are discrete and the choice must be placed based on the generated search scope (for priority 0). In other words, the new "1" priority experiment must come from the "0" priority rows. 

Once you complete these two functions, you run them in sequence. Make sure you import related modules and please write code in one code block.
Now I have completed the first 5 reactions in the lab, the observed yields are "6, 5, 5, 8, 0" for suggested reactions 1 to 5, their conditions are "
0.1	0.5	TCNHPI	Bu4NPF6	0	
0.075	0.5	QD	Et4NBF4	1	
0.075	0.5	QD	LiOTf	1	
0.075	0.5	NHPI	LiClO4	1	
0.05	0.5	TEMPO	Et4NBF4	0	
"
please write the code to help me suggest the next 5 experiments for me. Make sure you import related modules and please write code in one code block.