Book description
Discover powerful ways to effectively solve real-world machine learning problems using key libraries including scikit-learn, TensorFlow, and PyTorch
Key Features
- Learn and implement machine learning algorithms in a variety of real-life scenarios
- Cover a range of tasks catering to supervised, unsupervised and reinforcement learning techniques
- Find easy-to-follow code solutions for tackling common and not-so-common 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 real-world 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 recipe-based approach. With emphasis on practical solutions, dedicated sections in the book will help you to apply supervised and unsupervised learning techniques to real-world 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 real-world examples.
What you will learn
- Use predictive modeling and apply it to real-world 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 real-world challenges using machine-learning techniques and algorithms. If you are facing challenges at work and want ready-to-use 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.
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
- One-hot 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 cross-validation 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 k-means 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 three-dimensional scatter plots
- Plotting bubble plots
- Animating bubble plots
- Drawing pie charts
- Plotting date-formatted 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 k-nearest neighbors classifier
- Constructing a k-nearest 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 bag-of-words 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 OpenCV-Python
- 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 HOG-based 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 Q-learning
- Implementing the deep Q-learning algorithm
- Developing an AI-based dynamic modeling system
- Deep reinforcement learning with double Q-learning
- Deep Q-network algorithm with dueling Q-learning
-
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 t-SNE
- Using word embedding for Twitter sentiment analysis
- Implementing LDA with scikit-learn
- Using LDA to classify text documents
- Preparing data for LDA
-
Automated Machine Learning and Transfer Learning
- Technical requirements
- Introduction
- Working with Auto-WEKA
- Using AutoML to generate machine learning pipelines with TPOT
- Working with Auto-Keras
- Working with auto-sklearn
- Using MLBox for selection and leak detection
- Convolutional neural networks with transfer learning
- Transfer learning with pretrained image classifiers using ResNet-50
- 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
You might also like
book
Interpretable Machine Learning with Python
A deep and detailed dive into the key aspects and challenges of machine learning interpretability, complete …
book
Python Machine Learning By Example - Second Edition
Grasp machine learning concepts, techniques, and algorithms with the help of real-world examples using Python libraries …
book
Machine Learning with Python Cookbook
This practical guide provides nearly 200 self-contained recipes to help you solve machine learning challenges you …
book
Python Machine Learning By Example - Third Edition
A comprehensive guide to get you up to speed with the latest developments of practical machine …