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 2: Machine Learning versus Deep Learning

Activity 2: Creating a Logistic Regression Model Using Keras

Solution:

  1. Open a Jupyter Notebook from the start menu to implement this activity. Load in the bank dataset from the previous chapter. This should be somewhat preprocessed, we will use the pandas library for the data loading, so import the pandas library:

    import pandas as pd

    feats = pd.read_csv(‘bank_data_feats.csv’)

    target = pd.read_csv(‘bank_data_target.csv’)

  2. For the purposes of this activity, we will not perform any further preprocessing. As we did in the previous chapter, we will split the dataset into training and testing and leave the testing, until the very end when we evaluate our models:

    from sklearn.model_selection import train_test_split

    test_size = 0.2

    random_state = 42

    X_train, X_test, y_train, y_test = train_test_split(feats, target, test_size=test_size, random_state=random_state)

  3. We begin creating our model by initializing a model of...
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 £13.99/month. Cancel anytime
Visually different images