Python deeper insights into machine learning leverage benefits of machine learning techniques using Python a course in three modules Hearty instant download
Python deeper insights into machine learning leverage benefits of machine learning techniques using Python a course in three modules Hearty instant download
https://textbookfull.com/product/python-real-world-machine-
learning-real-world-machine-learning-take-your-python-machine-
learning-skills-to-the-next-level-1st-edition-joshi/
https://textbookfull.com/product/advanced-data-analytics-using-
python-with-machine-learning-deep-learning-and-nlp-examples-
mukhopadhyay/
https://textbookfull.com/product/practical-machine-learning-for-
data-analysis-using-python-1st-edition-abdulhamit-subasi/
https://textbookfull.com/product/data-science-and-machine-
learning-interview-questions-using-python-second-edition-
vishwanathan-narayanan/
Python for Probability Statistics and Machine Learning
José Unpingco
https://textbookfull.com/product/python-for-probability-
statistics-and-machine-learning-jose-unpingco/
https://textbookfull.com/product/thoughtful-machine-learning-
with-python-a-test-driven-approach-first-edition-kirk/
https://textbookfull.com/product/machine-learning-concepts-with-
python-and-the-jupyter-notebook-environment-using-
tensorflow-2-0-nikita-silaparasetty/
https://textbookfull.com/product/statistical-methods-for-machine-
learning-discover-how-to-transform-data-into-knowledge-with-
python-jason-brownlee/
Python: Deeper Insights
into Machine Learning
Leverage benefits of machine learning techniques
using Python
</>
LEARNING PATH
Python: Deeper Insights into
Machine Learning
BIRMINGHAM - MUMBAI
Python: Deeper Insights into Machine Learning
All rights reserved. No part of this course 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 course to ensure the accuracy
of the information presented. However, the information contained in this course
is sold without warranty, either express or implied. Neither the authors, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this course.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this course by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78712-857-6
www.packtpub.com
Credits
Reviewers
Richard Dutton
Dave Julian
Vahid Mirjalili
Hamidreza Sattari
Dmytro Taranovsky
Dr. Vahid Mirjalili
Jared Huffman
Ashwin Pajankar
Preface
Machine learning and predictive analytics are becoming one of the key strategies for
unlocking growth in a challenging contemporary marketplace .It is one of the fastest
growing trends in modern computing and everyone wants to get into the field of
machine learning. In order to obtain sufficient recognition in this field, one must be
able to understand and design a machine learning system that serves the needs of a
project. The idea is to prepare a Learning Path that will help you to tackle the real-
world complexities of modern machine learning with innovative and cutting-edge
techniques. Also, it will give you a solid foundation in the machine learning design
process, and enable you to build customized machine learning models to solve
unique problems
Module 2, Designing Machine Learning Systems with Python, acquaints you with large
library of packages for machine learning tasks. It introduces broad topics such
as big data, data properties, data sources, and data processing .You will further
explore models that form the foundation of many advanced nonlinear techniques.
This module will help you in understanding model selection and parameter tuning
techniques that could help in various case studies.
[i]
Preface
Module 3, Advanced Machine Learning with Python, helps you to build your skill
with deep architectures by using stacked denoising autoencoders. This module is a
blend of semi-supervised learning techniques, RBM and DBN algorithms .Further
this focuses on tools and techniques which will help in making consistent working
process.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this course—what you liked or disliked. Reader feedback is important for us as it
helps us develop titles that you will really get the most out of.
[ ii ]
Preface
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt course, we have a number of things to
help you to get the most from your purchase.
1. Log in or register to our website using your e-mail address and password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the course in the Search box.
5. Select the course for which you're looking to download the code files.
6. Choose from the drop-down menu where you purchased this course from.
7. Click on Code Download.
You can also download the code files by clicking on the Code Files button on the
course's webpage at the Packt Publishing website. This page can be accessed by
entering the course's name in the Search box. Please note that you need to be logged
in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder
using the latest version of:
[ iii ]
Preface
The code bundle for the course is also hosted on GitHub at https://github.com/
PacktPublishing/Python-Deeper-Insights-into-Machine-Learning.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our courses—maybe a mistake in the text
or the code—we would be grateful if you could report this to us. By doing so, you
can save other readers from frustration and help us improve subsequent versions
of this course. If you find any errata, please report them by visiting http://www.
packtpub.com/submit-errata, selecting your course, clicking on the Errata
Submission Form link, and entering the details of your errata. Once your errata are
verified, your submission will be accepted and the errata will be uploaded to our
website or added to any list of existing errata under the Errata section of that title.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you
valuable content.
Questions
If you have a problem with any aspect of this course, you can contact us at
[email protected], and we will do our best to address the problem.
[ iv ]
Course Module 1: Python Machine Learning
[i]
Table of Contents
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Table of Contents
[v]
Table of Contents
[ vi ]
Table of Contents
[ vii ]
Module 1
In this chapter, we will learn about the main concepts and different types of machine
learning. Together with a basic introduction to the relevant terminology, we will lay
the groundwork for successfully using machine learning techniques for practical
problem solving.
[3]
Giving Computers the Ability to Learn from Data
[4]
Chapter 1
Considering the example of e-mail spam filtering, we can train a model using a
supervised machine learning algorithm on a corpus of labeled e-mail, e-mail that are
correctly marked as spam or not-spam, to predict whether a new e-mail belongs to
either of the two categories. A supervised learning task with discrete class labels, such
as in the previous e-mail spam-filtering example, is also called a classification task.
Another subcategory of supervised learning is regression, where the outcome signal is
a continuous value:
[5]
Giving Computers the Ability to Learn from Data
However, the set of class labels does not have to be of a binary nature. The predictive
model learned by a supervised learning algorithm can assign any class label that was
presented in the training dataset to a new, unlabeled instance. A typical example of
a multi-class classification task is handwritten character recognition. Here, we could
collect a training dataset that consists of multiple handwritten examples of each letter
in the alphabet. Now, if a user provides a new handwritten character via an input
device, our predictive model will be able to predict the correct letter in the alphabet
with certain accuracy. However, our machine learning system would be unable to
correctly recognize any of the digits zero to nine, for example, if they were not part
of our training dataset.
The following figure illustrates the concept of a binary classification task given 30
training samples: 15 training samples are labeled as negative class (circles) and 15
training samples are labeled as positive class (plus signs). In this scenario, our dataset
is two-dimensional, which means that each sample has two values associated with
it: x1 and x2 . Now, we can use a supervised machine learning algorithm to learn a
rule—the decision boundary represented as a black dashed line—that can separate
those two classes and classify new data into each of those two categories given its x1
and x2 values:
[6]
Chapter 1
For example, let's assume that we are interested in predicting the Math SAT
scores of our students. If there is a relationship between the time spent studying
for the test and the final scores, we could use it as training data to learn a model
that uses the study time to predict the test scores of future students who are
planning to take this test.
The following figure illustrates the concept of linear regression. Given a predictor
variable x and a response variable y, we fit a straight line to this data that minimizes
the distance—most commonly the average squared distance—between the sample
points and the fitted line. We can now use the intercept and slope learned from this
data to predict the outcome variable of new data:
[7]
Giving Computers the Ability to Learn from Data
A popular example of reinforcement learning is a chess engine. Here, the agent decides
upon a series of moves depending on the state of the board (the environment), and the
reward can be defined as win or lose at the end of the game:
[8]
Chapter 1
The figure below illustrates how clustering can be applied to organizing unlabeled
data into three distinct groups based on the similarity of their features x1 and x2 :
[9]
Giving Computers the Ability to Learn from Data
[ 10 ]
Chapter 1
To keep the notation and implementation simple yet efficient, we will make use of
some of the basics of linear algebra. In the following chapters, we will use a matrix
and vector notation to refer to our data. We will follow the common convention to
represent each sample as separate row in a feature matrix X , where each feature is
stored as a separate column.
The Iris dataset, consisting of 150 samples and 4 features, can then be written as a
150 × 4 matrix X ∈ 150×4 :
[ 11 ]
Giving Computers the Ability to Learn from Data
For the rest of this book, we will use the superscript (i) to refer to the ith
training sample, and the subscript j to refer to the jth dimension of the
training dataset.
We use lower-case, bold-face letters to refer to vectors ( x ∈ R ) and
n×1
x j (1)
( 2)
x
xj = j
x (150)
j .
Similarly, we store the target variables (here: class labels) as a
y (1)
150-dimensional column vector y = … ( y ∈ {Setosa, Versicolor, Virginica} ) .
y (150)
[ 12 ]
Exploring the Variety of Random
Documents with Different Content
XXX
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com