Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Applied Deep Learning with Keras

You're reading from   Applied Deep Learning with Keras Solve complex real-life problems with the simplicity of Keras

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher
ISBN-13 9781838555078
Length 412 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Ritesh Bhagwat Ritesh Bhagwat
Author Profile Icon Ritesh Bhagwat
Ritesh Bhagwat
Mahla Abdolahnejad Mahla Abdolahnejad
Author Profile Icon Mahla Abdolahnejad
Mahla Abdolahnejad
Matthew Moocarme Matthew Moocarme
Author Profile Icon Matthew Moocarme
Matthew Moocarme
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

About the Book
About the Authors
Learning Objectives
Audience
Approach
Hardware Requirements
Software Requirements
Conventions
Installation and Setup
Installing the Code Bundle
Additional Resources
1. Introduction to Machine Learning with Keras FREE CHAPTER 2. Machine Learning versus Deep Learning 3. Deep Learning with Keras 4. Evaluate Your Model with Cross-Validation using Keras Wrappers 5. Improving Model Accuracy 6. Model Evaluation 7. Computer Vision with Convolutional Neural Networks 8. Transfer Learning and Pre-Trained Models 9. Sequential Modeling with Recurrent Neural Networks 1. Appendix

Chapter 6: Model Evaluation

Activity 11: Computing Accuracy and Null Accuracy of Neural Network When We Change the Train/Test Split

Solution:

  1. Import the required libraries. Load and explore the dataset:

    #import the libraries import numpy as np import pandas as pd

    #Load the Data patient_data=pd.read_csv(“Health_Data.csv”)##use the head function to get a glimpse data patient_data.head()

    The following figure shows the output of the preceding code:

    Figure 6.30: A screenshot of the patient readmission dataset
  2. Separate the independent and dependent variables. Since column 0, the patient_id column, does not add any value, we discard that column. Columns 1 to 8 are independent variables, and the last column is the dependent variable.

    The following figure shows the output of the preceding code:

    mydata=pd.read_csv(“Health_Data.csv”)X=mydata.iloc[:,1:9]y=mydata.iloc[:,9]

    X.head()

  3. Create dummy variables for the categorical variables. Note that the input should all be...
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
Visually different images