Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Machine Learning for Healthcare Analytics Projects

You're reading from  Machine Learning for Healthcare Analytics Projects

Product type Book
Published in Oct 2018
Publisher Packt
ISBN-13 9781789536591
Pages 134 pages
Edition 1st Edition
Languages

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
  1. We will now convert the learning rate into a variable by defining it in the Adam optimizer code block. We will use learn_rate as...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}