Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning for Healthcare Analytics Projects

You're reading from   Machine Learning for Healthcare Analytics Projects Build smart AI applications using neural network methodologies across the healthcare vertical market

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher Packt
ISBN-13 9781789536591
Length 134 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Eduonix Learning Solutions Eduonix Learning Solutions
Author Profile Icon Eduonix Learning Solutions
Eduonix Learning Solutions
Arrow right icon
View More author details
Toc

Generating predictions using optimal hyperparameters

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:

  1. 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)
  1. 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.

  1. Let's print off the first five and see what they look like. We get the following output:
  1. We are now going to do a classification report and get an...
You have been reading a chapter from
Machine Learning for Healthcare Analytics Projects
Published in: Oct 2018
Publisher: Packt
ISBN-13: 9781789536591
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 €18.99/month. Cancel anytime