We know now some optimal hyperparameters for our grid search. We will use these to predict the onset of diabetes for the patients in our dataset. To do this, we will carry out the following steps:
- We will predict whether diabetes will occur for every example in the dataset by using the predict() function, as shown in the following code snippet:
# generate predictions with optimal hyperparameters
y_pred = grid.predict(X_standardized)
- We will then use the .shape command to see what the predictions look like. The following screenshot shows the output for this step:
From the preceding screenshot, we can see that there are 392 predictions with a numerical value for each.
- Let's print off the first five and see what they look like. We get the following output:
- We are now going to do a classification report and get an...