It's now time to prepare our grid search algorithm. We will follow a step-by-step process to make it easier to understand and execute:
- The first thing that we will do is copy the create_model() function, which we created in the Building a Keras model section, and paste it into a new cell, as shown in the following screenshot:
- Now, we will define a random seed through NumPy. This helps us to create results that are reproducible. We are also going to add random initialization of weights and random divisions of data into different groups. We will set a starting point so that we have the same initialization and the same divisions for all the data. This can be done by adding a few lines of code above the create_model() function, as shown in the following screenshot:
- Our next step is to initialize the KerasClassifier that we imported...