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

Training the neural network

Now, we will move on to building and training the neural network. To do so, let's import some specific layers from Keras. Then, we will define a create_model() function to build the Keras model, and define the model type as Sequential. After this, we will define an input layer, a hidden layer and an output layer, compile the model, and finally print the model:

As we see in the preceding screenshot, we have our model summary. We have 112 parameters for the first layer, 36 for the second, and 25 for the third layer. We have a total of 173 parameters. These are all trainable data for our neural network, which is what we will be using to classify the patients as either having coronary artery disease or not having coronary artery disease.

We will now fit the model to the training data using the model.fit() function:

From the preceding screenshot...

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}