Mastering Predictive Analytics with scikit-learn and TensorFlow: Implement machine learning techniques to build advanced predictive models using Python
()
About this ebook
Learn advanced techniques to improve the performance and quality of your predictive models
Key Features
- Use ensemble methods to improve the performance of predictive analytics models
- Implement feature selection, dimensionality reduction, and cross-validation techniques
- Develop neural network models and master the basics of deep learning
Book Description
Python is a programming language that provides a wide range of features that can be used in the field of data science. Mastering Predictive Analytics with scikit-learn and TensorFlow covers various implementations of ensemble methods, how they are used with real-world datasets, and how they improve prediction accuracy in classification and regression problems.
This book starts with ensemble methods and their features. You will see that scikit-learn provides tools for choosing hyperparameters for models. As you make your way through the book, you will cover the nitty-gritty of predictive analytics and explore its features and characteristics. You will also be introduced to artificial neural networks and TensorFlow, and how it is used to create neural networks. In the final chapter, you will explore factors such as computational power, along with improvement methods and software enhancements for efficient predictive analytics.
By the end of this book, you will be well-versed in using deep neural networks to solve common problems in big data analysis.
What you will learn
- Use ensemble algorithms to obtain accurate predictions
- Apply dimensionality reduction techniques to combine features and build better models
- Choose the optimal hyperparameters using cross-validation
- Implement different techniques to solve current challenges in the predictive analytics domain
- Understand various elements of deep neural network (DNN) models
- Implement neural networks to solve both classification and regression problems
Who this book is for
Mastering Predictive Analytics with scikit-learn and TensorFlow is for data analysts, software engineers, and machine learning developers who are interested in implementing advanced predictive analytics using Python. Business intelligence experts will also find this book indispensable as it will teach them how to progress from basic predictive models to building advanced models and producing more accurate predictions. Prior knowledge of Python and familiarity with predictive analytics concepts are assumed.
Related to Mastering Predictive Analytics with scikit-learn and TensorFlow
Related ebooks
Become a Python Data Analyst: Perform exploratory data analysis and gain insight into scientific computing using Python Rating: 0 out of 5 stars0 ratingsPython Machine Learning By Example: The easiest way to get into machine learning Rating: 5 out of 5 stars5/5R Machine Learning Projects: Implement supervised, unsupervised, and reinforcement learning techniques using R 3.5 Rating: 0 out of 5 stars0 ratingsMastering Numerical Computing with NumPy: Master scientific computing and perform complex operations with ease Rating: 0 out of 5 stars0 ratingsPractical Convolutional Neural Networks: Implement advanced deep learning models using Python Rating: 0 out of 5 stars0 ratingsAdvanced Deep Learning with Python: Design and implement advanced next-generation AI solutions using TensorFlow and PyTorch Rating: 0 out of 5 stars0 ratingsGo Machine Learning Projects: Eight projects demonstrating end-to-end machine learning and predictive analytics applications in Go Rating: 0 out of 5 stars0 ratingsHands-On Data Science and Python Machine Learning: Perform data mining and machine learning efficiently using Python and Spark Rating: 0 out of 5 stars0 ratingsPython Data Analysis: Perform data collection, data processing, wrangling, visualization, and model building using Python Rating: 0 out of 5 stars0 ratingsMatplotlib for Python Developers: Effective techniques for data visualization with Python, 2nd Edition Rating: 0 out of 5 stars0 ratingsMachine Learning With Go: Leverage Go's powerful packages to build smart machine learning and predictive applications, 2nd Edition Rating: 0 out of 5 stars0 ratingsR Deep Learning Essentials.: A step-by-step guide to building deep learning models using TensorFlow, Keras, and MXNet Rating: 0 out of 5 stars0 ratingsLearning Data Mining with Python: Use Python to manipulate data and build predictive models Rating: 0 out of 5 stars0 ratingsPython Data Mining Quick Start Guide: A beginner's guide to extracting valuable insights from your data Rating: 0 out of 5 stars0 ratingsArtificial Intelligence By Example: Develop machine intelligence from scratch using real artificial intelligence use cases Rating: 0 out of 5 stars0 ratingsReinforcement Learning Algorithms with Python: Learn, understand, and develop smart algorithms for addressing AI challenges Rating: 0 out of 5 stars0 ratingsHands-On Data Analysis with NumPy and pandas: Implement Python packages from data manipulation to processing Rating: 0 out of 5 stars0 ratingsGetting Started with Python Data Analysis Rating: 0 out of 5 stars0 ratingsDeep Learning with PyTorch: A practical approach to building neural network models using PyTorch Rating: 0 out of 5 stars0 ratingsKNIME Essentials Rating: 0 out of 5 stars0 ratingsHands-on Machine Learning with JavaScript: Solve complex computational web problems using machine learning Rating: 0 out of 5 stars0 ratingsMastering Machine Learning with scikit-learn - Second Edition Rating: 0 out of 5 stars0 ratingsData Analysis with Python: Introducing NumPy, Pandas, Matplotlib, and Essential Elements of Python Programming (English Edition) Rating: 0 out of 5 stars0 ratings
Information Technology For You
Cyber Security Consultants Playbook Rating: 0 out of 5 stars0 ratingsData Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Summary of Super-Intelligence From Nick Bostrom Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5CompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsA Mind at Play: How Claude Shannon Invented the Information Age Rating: 4 out of 5 stars4/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsCybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsAn Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5CODING INTERVIEW: Advanced Methods to Learn and Excel in Coding Interview Rating: 0 out of 5 stars0 ratingsLearning Microsoft Endpoint Manager: Unified Endpoint Management with Intune and the Enterprise Mobility + Security Suite Rating: 0 out of 5 stars0 ratingsSupercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsCOMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsLinux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Inkscape Beginner’s Guide Rating: 5 out of 5 stars5/5Google SketchUp for Game Design: Beginner's Guide Rating: 5 out of 5 stars5/5Machine Learning Interview Questions Rating: 5 out of 5 stars5/5Getting started with Audacity 1.3 Rating: 5 out of 5 stars5/5Unity Game Development Essentials Rating: 5 out of 5 stars5/5CompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 5 out of 5 stars5/5Self-Sovereign Identity Rating: 0 out of 5 stars0 ratingsGet Programming with Haskell Rating: 0 out of 5 stars0 ratingsWordPress Plugin Development: Beginner's Guide Rating: 0 out of 5 stars0 ratings20 Windows Tools Every SysAdmin Should Know Rating: 5 out of 5 stars5/5
Reviews for Mastering Predictive Analytics with scikit-learn and TensorFlow
0 ratings0 reviews
Book preview
Mastering Predictive Analytics with scikit-learn and TensorFlow - Alan Fontaine
Mastering Predictive Analytics with scikit-learn and TensorFlow
Implement machine learning techniques to build advanced predictive models using Python
Alan Fontaine
BIRMINGHAM - MUMBAI
Mastering Predictive Analytics with scikit-learn and TensorFlow
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Sunith Shetty
Acquisition Editor: Namrata Patil
Content Development Editor: Athikho Sapuni Rishana
Technical Editor: Joseph Sunil
Copy Editor: Safis Editing
Project Coordinator: Kirti Pisat
Proofreader: Safis Editing
Indexer: Rekha Nair
Graphics: Jisha Chirayil
Production Coordinator: Deepika Naik
First published: September 2018
Production reference: 1280918
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78961-774-0
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Packt.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributor
About the author
Alan Fontaine is a data scientist with more than 12 years of experience in analytical roles. He has been a consultant for many projects in fields such as: business, education, medicine, mass media, among others. He is a big Python fan and has been using it routinely for five years for analyzing data, building models, producing reports, making predictions, and building interactive applications that transform data into intelligence.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Table of Contents
Title Page
Copyright and Credits
Mastering Predictive Analytics with scikit-learn and TensorFlow
Packt Upsell
Why subscribe?
Packt.com
Contributor
About the author
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Ensemble Methods for Regression and Classification
Ensemble methods and their working
Bootstrap sampling
Bagging
Random forests
Boosting
Ensemble methods for regression
The diamond dataset
Training different regression models
KNN model
Bagging model
Random forests model
Boosting model
Using ensemble methods for classification
Predicting a credit card dataset
Training different regression models
Logistic regression model
Bagging model
Random forest model
Boosting model
Summary
Cross-validation and Parameter Tuning
Holdout cross-validation
K-fold cross-validation
Implementing k-fold cross-validation
Comparing models with k-fold cross-validation
Introduction to hyperparameter tuning
Exhaustive grid search
Hyperparameter tuning in scikit-learn
Comparing tuned and untuned models
Summary
Working with Features
Feature selection methods
Removing dummy features with low variance
Identifying important features statistically
Recursive feature elimination
Dimensionality reduction and PCA
Feature engineering
Creating new features
Improving models with feature engineering
Training your model
Reducible and irreducible error
Summary
Introduction to Artificial Neural Networks and TensorFlow
Introduction to ANNs
Perceptrons
Multilayer perceptron
Elements of a deep neural network model
Deep learning
Elements of an MLP model
Introduction to TensorFlow
TensorFlow installation
Core concepts in TensorFlow
Tensors
Computational graph
Summary
Predictive Analytics with TensorFlow and Deep Neural Networks
Predictions with TensorFlow
Introduction to the MNIST dataset
Building classification models using MNIST dataset
Elements of the DNN model
Building the DNN
Reading the data
Defining the architecture
Placeholders for inputs and labels
Building the neural network
The loss function
Defining optimizer and training operations
Training strategy and valuation of accuracy of the classification
Running the computational graph
Regression with Deep Neural Networks (DNN)
Elements of the DNN model
Building the DNN
Reading the data
Objects for modeling
Training strategy
Input pipeline for the DNN
Defining the architecture
Placeholders for input values and labels
Building the DNN
The loss function
Defining optimizer and training operations
Running the computational graph
Classification with DNNs
Exponential linear unit activation function
Classification with DNNs
Elements of the DNN model
Building the DNN
Reading the data
Producing the objects for modeling
Training strategy
Input pipeline for DNN
Defining the architecture
Placeholders for inputs and labels
Building the neural network
The loss function
Evaluation nodes
Optimizer and the training operation
Run the computational graph
Evaluating the model with a set threshold
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
Preface
Python is a programming language that provides various features in the field of data science. In this book, we will be touching upon two Python libraries, scikit-learn and TensorFlow. We will learn about the various implementations of ensemble methods, how they are used with real-world datasets, and how they improve prediction accuracy in classification and regression problems.
This book starts with studying ensemble methods and their features. We will look at how scikit-learn provides the right tools to choose hyperparameters for models. From there, we will get down to the nitty-gritty of predictive analytics and explore its various features and characteristics. We will be introduced to artificial neural networks, TensorFlow, and the core concepts used to build neural networks.
In the final section, we will consider factors such as computational power, improved methods, and software enhancements for efficient predictive analytics. You will become well versed in using DNNs to solve common challenges.
Who this book is for
This book is for data analysts, software engineers, and machine learning developers who are interested in implementing advanced predictive analytics using Python. Business intelligence experts will also find this book indispensable as it will teach them how to go from basic predictive models to building advanced models and producing better predictions. Knowledge of Python and familiarity with predictive analytics concepts are assumed.
What this book covers
Chapter 1, Ensemble Methods for Regression and Classification, covers the application of ensemble methods or algorithms to produce accurate predictions of models. We will go through the application of ensemble methods for regression and classification problems.
Chapter 2, Cross-validation and Parameter Tuning, explores various