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

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...
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}