Book Image

Python Machine Learning Cookbook

By : Prateek Joshi, Vahid Mirjalili
Book Image

Python Machine Learning Cookbook

By: Prateek Joshi, Vahid Mirjalili

Overview of this book

Machine learning is becoming increasingly pervasive in the modern data-driven world. It is used extensively across many fields such as search engines, robotics, self-driving cars, and more. With this book, you will learn how to perform various machine learning tasks in different environments. We’ll start by exploring a range of real-life scenarios where machine learning can be used, and look at various building blocks. Throughout the book, you’ll use a wide variety of machine learning algorithms to solve real-world problems and use Python to implement these algorithms. You’ll discover how to deal with various types of data and explore the differences between machine learning paradigms such as supervised and unsupervised learning. We also cover a range of regression techniques, classification algorithms, predictive modeling, data visualization techniques, recommendation engines, and more with the help of real-world examples.
Table of Contents (19 chapters)
Python Machine Learning Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Index

A

  • accuracy
    • evaluating, with cross validation / Getting ready…
  • AdaBoost / Estimating housing prices
  • Adaptive Boosting technique
    • reference / Building a face detector using Haar cascades
  • Affinity Propagation / Finding patterns in stock market data
  • agglomerative clustering
    • about / Grouping data using agglomerative clustering
    • reference / Grouping data using agglomerative clustering
    • used, for grouping data / How to do it…
  • audio data
    • reading / Reading and plotting audio data, How to do it…
    • plotting / Reading and plotting audio data, How to do it…
  • audio signal
    • transforming, into frequency domain / Transforming audio signals into the frequency domain, How to do it…
  • audio signals
    • generating, custom parameters used / Generating audio signals with custom parameters, How to do it…

B

  • bag-of-words model
    • building / Building a bag-of-words model, How to do it…, How it works…
  • bicycle demand distribution
    • estimating / Estimating bicycle demand distribution, How to do it…, There's more…
  • blind source separation
    • about / Performing blind source separation
    • performing / Performing blind source separation, How to do it…
    • reference / Performing blind source separation
  • bubble plots
    • plotting / Plotting bubble plots, How to do it…
    • animating / Animating bubble plots, How to do it…

C

  • canny edge detector
    • about / How to do it…
    • URL / How to do it…
  • cars
    • evaluating, based on characteristics / Evaluating cars based on their characteristics, Getting ready, How to do it…
  • characters
    • visualizing, in optical character recognition database / Visualizing the characters in an optical character recognition database, How to do it…
  • chunking
    • used, for dividing text / Dividing text using chunking, How to do it…
    • about / Dividing text using chunking
  • classifier
    • constructing / Introduction
  • class imbalance
    • tackling / Tackling class imbalance, How to do it…
  • clustering
    • about / Introduction
  • clustering algorithms
    • performance, evaluating / Evaluating the performance of clustering algorithms, How to do it…
  • color scheme options
    • reference / How to do it…
  • Computer Vision
    • about / Introduction
  • conditional random fields (CRFs)
    • about / Building Conditional Random Fields for sequential text data
    • building, for sequential text data / Building Conditional Random Fields for sequential text data, Getting ready, How to do it…
  • confidence measurements
    • extracting / Extracting confidence measurements, How to do it…
  • confusion matrix
    • visualizing / Visualizing the confusion matrix, How to do it…
    • about / Visualizing the confusion matrix
  • corner detection
    • about / Detecting corners, How to do it…
  • cross validation
    • about / Evaluating the accuracy using cross-validation
    • used, for evaluating accuracy / Evaluating the accuracy using cross-validation, Getting ready…
  • customer segmentation model
    • building / Building a customer segmentation model, How to do it…
  • custom parameters
    • used, for generating audio signals / Generating audio signals with custom parameters, How to do it…

D

  • 3D scatter plots
    • plotting / Plotting 3D scatter plots
  • data
    • preprocessing, different techniques used / Preprocessing data using different techniques, How to do it…
    • preprocessing ways / How to do it…
    • clustering, k-means algorithm used / Clustering data using the k-means algorithm, How to do it…
    • gourping, agglomerative clustering used / Grouping data using agglomerative clustering, How to do it…
    • preprocessing, tokenization used / Preprocessing data using tokenization, How to do it…
    • transforming, into time series format / Transforming data into the time series format, How to do it…
  • data preprocessing ways
    • mean removal / Mean removal
    • scaling / Scaling
    • normalization / Normalization
    • binarization / Binarization
    • One Hot Encoding / One Hot Encoding
  • dataset
    • splitting, for training and testing / Splitting the dataset for training and testing, How to do it…
    • reference / Building an event predictor, Getting ready, Visualizing the characters in an optical character recognition database
    • similar users, finding / Finding similar users in the dataset, How to do it…
  • dataset attributes
    • buying / Getting ready
    • maint / Getting ready
    • doors / Getting ready
    • persons / Getting ready
    • lug_boot / Getting ready
    • safety / Getting ready
  • data visualization
    • about / Introduction
  • date-formatted time series data
    • plotting / Plotting date-formatted time series data, How to do it…
  • DBSCAN algorithm
    • about / Automatically estimating the number of clusters using DBSCAN algorithm
    • used, for estimating number of clusters / Automatically estimating the number of clusters using DBSCAN algorithm, How to do it…
    • reference / Automatically estimating the number of clusters using DBSCAN algorithm
  • decision tree regressor / Estimating housing prices
  • deep neural network
    • building / Building a deep neural network, How to do it…
  • dynamic signals
    • animating / Animating dynamic signals, How to do it…

E

  • edge detection
    • about / Detecting edges
    • performing / Detecting edges, How to do it…
  • empty squares / Getting ready
  • epsilon
    • about / Automatically estimating the number of clusters using DBSCAN algorithm
  • Euclidean distance score
    • computing / Computing the Euclidean distance score, How to do it…
  • event predictor
    • building / Building an event predictor, Getting ready, How to do it…
  • exemplars
    • reference / Finding patterns in stock market data
  • extremely random forests (ERFs)
    • about / Training an image classifier using Extremely Random Forests
    • used, for training image classifier / Training an image classifier using Extremely Random Forests, How to do it…
    • reference / Training an image classifier using Extremely Random Forests
  • eye and nose detectors
    • building / Building eye and nose detectors, How to do it…

F

  • face dataset
    • reference / Building a face recognizer using Local Binary Patterns Histogram
  • face detector
    • building, Haar cascades used / Building a face detector using Haar cascades, How to do it…
  • face recognition
    • about / Introduction
  • face recognizer
    • building, Local Binary Patterns Histograms used / Building a face recognizer using Local Binary Patterns Histogram, How to do it…
  • features
    • creating, visual codebook and vector quantization used / Creating features using visual codebook and vector quantization, How to do it…
  • Fourier transforms
    • URL / Transforming audio signals into the frequency domain
  • frequency domain
    • audio signal, transforming / Transforming audio signals into the frequency domain, How to do it…
  • frequency domain features
    • extracting / Extracting frequency domain features, How to do it…
  • function compositions
    • building, for data processing / Building function compositions for data processing, How to do it…

G

  • gender
    • identifying / Identifying the gender, How to do it…
  • gradient descent
    • reference / How to do it…

H

  • Haar cascades
    • about / Building a face detector using Haar cascades
    • used, for face detection / Building a face detector using Haar cascades, How to do it…
  • Harris corner detector function
    • reference / How to do it…
  • heat maps
    • visualizing / Visualizing heat maps, How to do it…
  • hidden layers
    • about / Introduction
  • hidden Markov models (HMMs)
    • building / Building Hidden Markov Models, How to do it…
    • URL / Building Hidden Markov Models
    • about / Building Hidden Markov Models for sequential data
    • building, for sequential data / Building Hidden Markov Models for sequential data, How to do it…
    • used, for analyzing stock market data / Analyzing stock market data using Hidden Markov Models, How to do it…
  • hierarchical clustering
    • about / Grouping data using agglomerative clustering
  • histogram equalization
    • about / Histogram equalization, How to do it…
  • histograms
    • plotting / Plotting histograms, How to do it…
  • housing prices
    • estimating / Estimating housing prices, Getting ready, How to do it…
  • hyperparameters
    • about / Extracting validation curves
  • hypotrochoid / How to do it…

I

  • image
    • compressing, vector quantization used / Compressing an image using vector quantization, How to do it…
  • image classifier
    • training, extremely random forests used / Training an image classifier using Extremely Random Forests, How to do it…
  • images
    • operating, OpenCV-Python used / Operating on images using OpenCV-Python, How to do it…
  • income bracket
    • estimating / Estimating the income bracket, How to do it…
  • inverse document frequency (IDF) / Building a text classifier, How it works…

K

  • k-means algorithm
    • about / Clustering data using the k-means algorithm
    • used, for clustering data / Clustering data using the k-means algorithm, How to do it…
    • reference / Clustering data using the k-means algorithm
  • k-means clustering
    • about / How to do it…
  • k-nearest neighbors
    • about / Constructing a k-nearest neighbors classifier
  • k-nearest neighbors classifier
    • constructing / Constructing a k-nearest neighbors classifier, How to do it…, How it works…
  • k-nearest neighbors regressor
    • constructing / Constructing a k-nearest neighbors regressor, How to do it…, How it works…
  • Kernel Principal Components Analysis
    • performing / Performing Kernel Principal Components Analysis, How to do it…
    • reference / Performing Kernel Principal Components Analysis
  • kernels
    • reference / How to do it…

L

  • label encoding
    • about / Label encoding, How to do it…
  • Laplacian edge detector
    • about / How to do it…
    • URL / How to do it…
  • Latent Dirichlet Allocation (LDA)
    • about / How to do it…
    • reference / How it works…
  • learning curves
    • about / Extracting learning curves
    • extracting / Extracting learning curves, How to do it…
  • learning vector quantization (LVQ) neural network / How to do it…
  • lemmatization
    • used, for converting text to base form / Converting text to its base form using lemmatization, How to do it…
  • linear classifier
    • building, Support Vector Machine (SVMs) used / Building a linear classifier using Support Vector Machine (SVMs), Getting ready, How to do it…
  • linear regressor
    • building / Building a linear regressor, Getting ready, How to do it…
  • Local Binary Patterns Histograms
    • used, for building face recognizer / Building a face recognizer using Local Binary Patterns Histogram, How to do it…
    • about / Building a face recognizer using Local Binary Patterns Histogram
    • reference / Building a face recognizer using Local Binary Patterns Histogram
  • logistic regression classifier
    • building / Building a logistic regression classifier, How to do it…

M

  • machine learning pipelines
    • building / Building machine learning pipelines, How to do it…, How it works…
  • matplotlib
    • URL / Introduction
  • mean shift
    • about / Building a Mean Shift clustering model
    • reference / Building a Mean Shift clustering model
  • mean shift clustering model
    • building / Building a Mean Shift clustering model, How to do it…
  • Mel Frequency Cepstral Coefficients (MFCC)
    • about / Extracting frequency domain features
    • URL / Extracting frequency domain features
  • model persistence
    • achieving / Achieving model persistence, How to do it…
  • movie recommendations
    • generating / Generating movie recommendations, How to do it…
  • music
    • synthesizing / Synthesizing music, How to do it…
    • URL / Synthesizing music

N

  • natural language processing (NLP)
    • about / Introduction
  • Natural Language Toolkit (NLTK)
    • about / Introduction
    • references / Introduction
  • Naïve Bayes classifier
    • about / Building a Naive Bayes classifier
    • building / How to do it…
  • nearest neighbors
    • finding / Finding the nearest neighbors, How to do it…
    • about / Finding the nearest neighbors
  • neural networks
    • reference, for tutorial / Introduction
    • used, for building optical character / Building an optical character recognizer using neural networks, How to do it…
  • NeuroLab
    • reference / Introduction
  • neurons
    • about / Introduction
  • nonlinear classifier
    • building, SVMs used / Building a nonlinear classifier using SVMs, How to do it…
  • number of clusters
    • estimating automatically, DBSCAN algorithm used / Automatically estimating the number of clusters using DBSCAN algorithm, How to do it…
  • NumPy
    • URL / Introduction

O

  • object recognizer
    • building / Building an object recognizer, How to do it…
  • OpenCV
    • about / Introduction
    • URL / Introduction
  • OpenCV-Python
    • used, for operating on images / Operating on images using OpenCV-Python, How to do it…
  • optical character recognizer
    • building, neural networks used / Building an optical character recognizer using neural networks, How to do it…
  • optimal hyperparameters
    • searching / Finding optimal hyperparameters, How to do it…
  • Ordinary Least Squares
    • about / Getting ready

P

  • pandas
    • URL / Transforming data into the time series format
  • patterns
    • finding, in stock market data / Finding patterns in stock market data, How to do it…
  • Pearson correlation score
    • computing / Computing the Pearson correlation score, How to do it…
  • perceptron
    • about / Building a perceptron
    • building / Building a perceptron, How to do it…
  • performance report
    • extracting / Extracting the performance report, How to do it…
  • pie charts
    • drawing / Drawing pie charts, How to do it…
  • Platt scaling
    • about / How to do it…
    • reference / How to do it…
  • polynomial regressor
    • building / Building a polynomial regressor, Getting ready, How to do it…
  • predictive modeling
    • about / Introduction
  • Principal Components Analysis (PCA)
    • performing / Performing Principal Components Analysis, How to do it…
    • reference / Performing Principal Components Analysis
  • pystruct
    • reference / Getting ready
  • Python packages
    • NumPy / Introduction
    • SciPy / Introduction
    • scikit-learn / Introduction
    • matplotlib / Introduction

R

  • random forest regressor / Estimating bicycle demand distribution
  • random forests
    • reference / Training an image classifier using Extremely Random Forests
  • recommendation engine
    • about / Introduction
  • recurrent neural network
    • building, for sequential data analysis / Building a recurrent neural network for sequential data analysis, How to do it…
    • reference / Building a recurrent neural network for sequential data analysis
  • regression
    • about / Building a linear regressor
  • regression accuracy
    • computing / Computing regression accuracy, How to do it…
    • mean absolute error / Getting ready
    • mean squared error / Getting ready
    • median absolute error / Getting ready
    • explained variance score / Getting ready
    • R2 score / Getting ready
  • regularization / Getting ready
  • relative importance of features
    • computing / Computing the relative importance of features, How to do it…
  • Ridge Regression / Getting ready
  • ridge regressor
    • building / Building a ridge regressor, Getting ready, How to do it…

S

  • Scale Invariant Feature Transform (SIFT)
    • about / Detecting SIFT feature points
  • SciPy
    • URL / Introduction
  • sentiment analysis
    • about / Analyzing the sentiment of a sentence
    • performing / Analyzing the sentiment of a sentence, How to do it…, How it works…
  • SIFT feature points
    • detecting / Detecting SIFT feature points, How to do it…
  • Silhouette Coefficient score
    • about / Evaluating the performance of clustering algorithms
  • simple classifier
    • building / Building a simple classifier, How to do it…, There's more…
  • single layer neural network
    • building / Building a single layer neural network, How to do it…
  • sobel filter
    • about / How to do it…
    • URL / How to do it…
  • solid squares / Getting ready
  • speech recognizer
    • about / Introduction
    • building / Building a speech recognizer, How to do it…
  • Star feature detector
    • building / Building a Star feature detector, How to do it…
  • statistics
    • extracting, from time series data / Extracting statistics from time series data, How to do it…
  • stock market data
    • patterns, finding in / Finding patterns in stock market data, How to do it…
    • analyzing, hidden Markov models used / Analyzing stock market data using Hidden Markov Models, How to do it…
  • support vector machine / How to do it…
  • Support Vector Machine (SVMs)
    • used, for building linear classifier / Building a linear classifier using Support Vector Machine (SVMs), Getting ready, How to do it…
    • references, for tutorials / Building a linear classifier using Support Vector Machine (SVMs)
    • used, for building nonlinear classifier / Building a nonlinear classifier using SVMs, How to do it…

T

  • term frequency (TF) / Building a text classifier, How it works…
  • text
    • converting, to base form with lemmatization / Converting text to its base form using lemmatization, How to do it…
    • dividing, chunking used / Dividing text using chunking, How to do it…
    • patterns, identifying with topic modeling / Identifying patterns in text using topic modeling, How to do it…, How it works…
  • text analysis
    • about / Introduction
  • text classifier
    • building / Building a text classifier, How to do it…
  • text data
    • stemming / Stemming text data, How it works…
  • tf-idf
    • about / Building a text classifier
    • URL / Building a text classifier
  • time series data
    • about / Introduction
    • slicing / Slicing time series data, How to do it…
    • operating on / Operating on time series data, How to do it…
    • statistics, extracting from / Extracting statistics from time series data, How to do it…
  • time series format
    • data, transforming into / Transforming data into the time series format, How to do it…
  • tokenization
    • about / Preprocessing data using tokenization
    • used, for preprocessing data / Preprocessing data using tokenization, How to do it…
  • topic modeling
    • about / Identifying patterns in text using topic modeling
    • used, for identifying patterns in text / Identifying patterns in text using topic modeling, How to do it…, How it works…
  • traffic
    • estimating / Estimating traffic, How to do it…

U

  • unsupervised learning
    • about / Introduction

V

  • validation curves
    • extracting / Extracting validation curves, How to do it…
  • vector quantization
    • about / Compressing an image using vector quantization, How to do it…, Creating a vector quantizer
    • used, for compressing image / Compressing an image using vector quantization, How to do it…
    • reference / Compressing an image using vector quantization, How to do it…
    • used, for creating features / Creating features using visual codebook and vector quantization, How to do it…
  • vector quantizer
    • creating / Creating a vector quantizer, How to do it…
  • video
    • capturing, from webcam / Capturing and processing video from a webcam, How to do it…
    • processing, from webcam / Capturing and processing video from a webcam, How to do it…
  • visual codebook
    • used, for creating features / Creating features using visual codebook and vector quantization, How to do it…
    • about / Creating features using visual codebook and vector quantization
    • references / Creating features using visual codebook and vector quantization

W

  • weak learners / Getting ready
  • wholesale vendor and customers
    • reference / Building a customer segmentation model