Reducing overfitting using dropout regularization

We will now use the information we gained in the Performing a grid search using scikit-learn section to optimize other aspects of our model. It looks like we might be overfitting the data a little bit, as we are getting better results on our training data than our testing data. We're now going to look at adding in dropout regularization:

  1. Our first step is to copy the code that is present in the grid search cell that we ran in the previous section, and paste it in a fresh cell. We will keep the general structure of the code and play around with some of the parameters present. 
  1. We will then import the Dropout function from keras.layers using the following line:
from keras.layers import Dropout ...

Get Machine Learning for Healthcare Analytics Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.