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

Building our Keras model

We'll now start building our Keras model, which is a deep learning algorithm:

  1. The first thing that we're going to do is import the necessary packages and layers. We will do that by running the following lines of code:
from sklearn.model_selection import GridSearchCV, KFold
from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scikit_learn import KerasClassifier
from keras.optimizers import Adam

In the preceding code snippet , GridSearchCV is the function we will use to perform a grid search, and KFold will be used for performing the k-fold cross-validation. KerasClassifier is used as the wrapper. Adam is the optimizer that we will be using for this model; the rest of the functions are all general functions used to define the model:

  1. Let's start by defining the model. We will use a create_model() function, because...
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}