Book Description
Discover powerful ways to effectively solve realworld machine learning problems using key libraries including scikitlearn, TensorFlow, and PyTorch
Key Features
 Learn and implement machine learning algorithms in a variety of reallife scenarios
 Cover a range of tasks catering to supervised, unsupervised and reinforcement learning techniques
 Find easytofollow code solutions for tackling common and notsocommon challenges
Book Description
This eagerly anticipated second edition of the popular Python Machine Learning Cookbook will enable you to adopt a fresh approach to dealing with realworld machine learning and deep learning tasks.
With the help of over 100 recipes, you will learn to build powerful machine learning applications using modern libraries from the Python ecosystem. The book will also guide you on how to implement various machine learning algorithms for classification, clustering, and recommendation engines, using a recipebased approach. With emphasis on practical solutions, dedicated sections in the book will help you to apply supervised and unsupervised learning techniques to realworld problems. Toward the concluding chapters, you will get to grips with recipes that teach you advanced techniques including reinforcement learning, deep neural networks, and automated machine learning.
By the end of this book, you will be equipped with the skills you need to apply machine learning techniques and leverage the full capabilities of the Python ecosystem through realworld examples.
What you will learn
 Use predictive modeling and apply it to realworld problems
 Explore data visualization techniques to interact with your data
 Learn how to build a recommendation engine
 Understand how to interact with text data and build models to analyze it
 Work with speech data and recognize spoken words using Hidden Markov Models
 Get well versed with reinforcement learning, automated ML, and transfer learning
 Work with image data and build systems for image recognition and biometric face recognition
 Use deep neural networks to build an optical character recognition system
Who this book is for
This book is for data scientists, machine learning developers, deep learning enthusiasts and Python programmers who want to solve realworld challenges using machinelearning techniques and algorithms. If you are facing challenges at work and want readytouse code solutions to cover key tasks in machine learning and the deep learning domain, then this book is what you need. Familiarity with Python programming and machine learning concepts will be useful.
Publisher Resources
Table of Contents
 Title Page
 Copyright and Credits
 About Packt
 Contributors
 Preface

The Realm of Supervised Learning
 Technical requirements
 Introduction
 Array creation in Python
 Data preprocessing using mean removal
 Data scaling
 Normalization
 Binarization
 Onehot encoding
 Label encoding
 Building a linear regressor
 Computing regression accuracy
 Achieving model persistence
 Building a ridge regressor
 Building a polynomial regressor
 Estimating housing prices
 Computing the relative importance of features
 Estimating bicycle demand distribution

Constructing a Classifier
 Technical requirements
 Introduction
 Building a simple classifier
 Building a logistic regression classifier
 Building a Naive Bayes classifier
 Splitting a dataset for training and testing
 Evaluating accuracy using crossvalidation metrics
 Visualizing a confusion matrix
 Extracting a performance report
 Evaluating cars based on their characteristics
 Extracting validation curves
 Extracting learning curves
 Estimating the income bracket
 Predicting the quality of wine
 Newsgroup trending topics classification

Predictive Modeling
 Technical requirements
 Introduction
 Building a linear classifier using SVMs
 Building a nonlinear classifier using SVMs
 Tackling class imbalance
 Extracting confidence measurements
 Finding optimal hyperparameters
 Building an event predictor
 Estimating traffic
 Simplifying machine learning workflow using TensorFlow
 Implementing a stacking method

Clustering with Unsupervised Learning
 Technical requirements
 Introduction
 Clustering data using the kmeans algorithm
 Compressing an image using vector quantization
 Grouping data using agglomerative clustering
 Evaluating the performance of clustering algorithms
 Estimating the number of clusters using the DBSCAN algorithm
 Finding patterns in stock market data
 Building a customer segmentation model
 Using autoencoders to reconstruct handwritten digit images

Visualizing Data
 Technical requirements
 An introduction to data visualization
 Plotting threedimensional scatter plots
 Plotting bubble plots
 Animating bubble plots
 Drawing pie charts
 Plotting dateformatted time series data
 Plotting histograms
 Visualizing heat maps
 Animating dynamic signals
 Working with the Seaborn library

Building Recommendation Engines
 Technical requirements
 Introducing the recommendation engine
 Building function compositions for data processing
 Building machine learning pipelines
 Finding the nearest neighbors
 Constructing a knearest neighbors classifier
 Constructing a knearest neighbors regressor
 Computing the Euclidean distance score
 Computing the Pearson correlation score
 Finding similar users in the dataset
 Generating movie recommendations
 Implementing ranking algorithms
 Building a filtering model using TensorFlow

Analyzing Text Data
 Technical requirements
 Introduction
 Preprocessing data using tokenization
 Stemming text data
 Converting text to its base form using lemmatization
 Dividing text using chunking
 Building a bagofwords model
 Building a text classifier
 Identifying the gender of a name
 Analyzing the sentiment of a sentence
 Identifying patterns in text using topic modeling
 Parts of speech tagging with spaCy
 Word2Vec using gensim
 Shallow learning for spam detection

Speech Recognition
 Technical requirements
 Introducing speech recognition
 Reading and plotting audio data
 Transforming audio signals into the frequency domain
 Generating audio signals with custom parameters
 Synthesizing music
 Extracting frequency domain features
 Building HMMs
 Building a speech recognizer
 Building a TTS system

Dissecting Time Series and Sequential Data
 Technical requirements
 Introducing time series
 Transforming data into a time series format
 Slicing time series data
 Operating on time series data
 Extracting statistics from time series data
 Building HMMs for sequential data
 Building CRFs for sequential text data
 Analyzing stock market data
 Using RNNs to predict time series data

Analyzing Image Content
 Technical requirements
 Introducing computer vision
 Operating on images using OpenCVPython
 Detecting edges
 Histogram equalization
 Detecting corners
 Detecting SIFT feature points
 Building a Star feature detector
 Creating features using Visual Codebook and vector quantization
 Training an image classifier using Extremely Random Forests
 Building an object recognizer
 Using Light GBM for image classification

Biometric Face Recognition
 Technical requirements
 Introduction
 Capturing and processing video from a webcam
 Building a face detector using Haar cascades
 Building eye and nose detectors
 Performing principal component analysis
 Performing kernel principal component analysis
 Performing blind source separation
 Building a face recognizer using a local binary patterns histogram
 Recognizing faces using the HOGbased model
 Facial landmark recognition
 User authentication by face recognition

Reinforcement Learning Techniques
 Technical requirements
 Introduction
 Weather forecasting with MDP
 Optimizing a financial portfolio using DP
 Finding the shortest path
 Deciding the discount factor using Qlearning
 Implementing the deep Qlearning algorithm
 Developing an AIbased dynamic modeling system
 Deep reinforcement learning with double Qlearning
 Deep Qnetwork algorithm with dueling Qlearning

Deep Neural Networks
 Technical requirements
 Introduction
 Building a perceptron
 Building a single layer neural network
 Building a deep neural network
 Creating a vector quantizer
 Building a recurrent neural network for sequential data analysis
 Visualizing the characters in an OCR database
 Building an optical character recognizer using neural networks
 Implementing optimization algorithms in ANN

Unsupervised Representation Learning
 Technical requirements
 Introduction
 Using denoising autoencoders to detect fraudulent transactions
 Generating word embeddings using CBOW and skipgram representations
 Visualizing the MNIST dataset using PCA and tSNE
 Using word embedding for Twitter sentiment analysis
 Implementing LDA with scikitlearn
 Using LDA to classify text documents
 Preparing data for LDA

Automated Machine Learning and Transfer Learning
 Technical requirements
 Introduction
 Working with AutoWEKA
 Using AutoML to generate machine learning pipelines with TPOT
 Working with AutoKeras
 Working with autosklearn
 Using MLBox for selection and leak detection
 Convolutional neural networks with transfer learning
 Transfer learning with pretrained image classifiers using ResNet50
 Transfer learning using feature extraction with the VGG16 model
 Transfer learning with pretrained GloVe embedding
 Unlocking Production Issues
 Other Books You May Enjoy
Product Information
 Title: Python Machine Learning Cookbook  Second Edition
 Author(s):
 Release date: March 2019
 Publisher(s): Packt Publishing
 ISBN: 9781789808452