Download Full Supervised Learning with Python: Concepts and Practical Implementation Using Python Vaibhav Verdhan PDF All Chapters
Download Full Supervised Learning with Python: Concepts and Practical Implementation Using Python Vaibhav Verdhan PDF All Chapters
com
https://textbookfull.com/product/supervised-learning-with-
python-concepts-and-practical-implementation-using-python-
vaibhav-verdhan/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/supervised-learning-with-python-
concepts-and-practical-implementation-using-python-1st-edition-
vaibhav-verdhan/
textboxfull.com
https://textbookfull.com/product/practical-machine-learning-for-data-
analysis-using-python-1st-edition-abdulhamit-subasi/
textboxfull.com
https://textbookfull.com/product/advanced-data-analytics-using-python-
with-machine-learning-deep-learning-and-nlp-examples-mukhopadhyay/
textboxfull.com
https://textbookfull.com/product/practical-python-data-visualization-
a-fast-track-approach-to-learning-data-visualization-with-python-
ashwin-pajankar/
textboxfull.com
https://textbookfull.com/product/deep-learning-with-python-develop-
deep-learning-models-on-theano-and-tensorflow-using-keras-jason-
brownlee/
textboxfull.com
https://textbookfull.com/product/learning-data-mining-with-python-
layton/
textboxfull.com
Supervised
Learning with
Python
Concepts and Practical
Implementation Using Python
—
Vaibhav Verdhan
Foreword by Dr. Eli Yechezkiel Kling (PhD)
Supervised Learning
with Python
Concepts and Practical
Implementation Using Python
Vaibhav Verdhan
Foreword by Dr. Eli Yechezkiel Kling (PhD)
Supervised Learning with Python: Concepts and Practical
Implementation Using Python
Vaibhav Verdhan
Limerick, Ireland
v
Table of Contents
ML’s Popularity����������������������������������������������������������������������������������������������������39
Use Cases of ML�������������������������������������������������������������������������������������������������41
Summary������������������������������������������������������������������������������������������������������������44
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
Index�������������������������������������������������������������������������������������������������367
ix
About the Author
Vaibhav Verdhan has 12+ years of experience
in data science, machine learning, and
artificial intelligence. An MBA with
engineering background, he is a hands-on
technical expert with acumen to assimilate
and analyze data. He has led multiple
engagements in ML and AI across geographies
and across retail, telecom, manufacturing,
energy, and utilities domains. Currently
he resides in Ireland with his family and is
working as a Principal Data Scientist.
xi
About the Technical Reviewer
Irfan Elahi is a full stack customer-focused
cloud analytics specialist bearing the unique
and proven combination of diverse consulting
and technical competencies (cloud, big
data, and machine learning) with a growing
portfolio of successful projects delivering
substantial impact and value in multiple
capacities across telecom, retail, energy,
and health-care sectors. Additionally, he is
an analytics evangelist as is evident from
the published book, Udemy courses, blogposts, trainings, lectures, and
presentations with global reach.
xiii
Foreword
How safe is home birthing? That is a good question. Pause a moment and
let yourself contemplate it.
I am sure you can see how the answer to this question can affect
personal decisions and policy choices. The answer could be given as a
probability, a level classification, or an alternative cost. Another natural
reaction is “it depends.” There are many factors that could affect the safety
of home birthing.
I took you through this thought exercise to show you that you naturally
think like a data scientist. You understood the importance of stipulating
clearly the focus of the analysis and what could explain different outcomes.
The reason you are embarking on a journey through this book is that you
are not sure how to express these instinctive notions mathematically and
instruct a computer to “find” the relationship between the “Features” and
the “Target.”
When I started my career 30-odd years ago, this was the domain
of statisticians who crafted a mathematical language to describe
relationships and noise. The purpose of predictive modeling was in its
essence to be a tool for separating a signal or a pattern out of seemingly
chaotic information and reporting how well the partition was done.
Today, machine learning algorithms harnessing computing brute force
add a new paradigm. This has created a new profession: the data scientist.
The data scientist is a practitioner who can think in terms of statistical
methodology, instruct a computer to carry out the required processing,
and interpret the results and reports.
xv
Foreword
Becoming a good data scientist is a journey that starts with learning the
basics and mechanics. Once you are done exploring this book you might
also be able to better see where you will want to deepen your theoretical
knowledge. I would like to suggest you might find it interesting to look into
the theory of statistical modeling in general and the Bayesian paradigm
specifically. Machine learning is computational statistics after all.
Dr. Eli. Y. Kling (BSc. Eng. MSc. PHD) London, UK. June 2020.
xvi
Acknowledgments
I would like to thank Apress publications, Celestin John, Shrikant
Vishwarkarma, and Irfan Elahi for the confidence shown and the support
extended. Many thanks to Dr. Eli Kling for the fantastic forward to the
book. Special words for my family—Yashi, Pakhi, and Rudra—without their
support it would have been impossible to complete this work.
xvii
Introduction
“It is tough to make predictions, especially about the future.”
—Yogi Berra
xix
Introduction
xx
CHAPTER 1
Introduction to
Supervised Learning
“The future belongs to those who prepare for it today.”
— Malcom X
What Is ML?
When we post a picture on Facebook or shop at Amazon, tweet or watch
videos on YouTube, each of these platforms is collecting data for us. At
each of these interactions, we are leaving behind our digital footprints.
These data points generated are collected and analyzed, and ML allows
these giants to make logical recommendations to us. Based on the genre
of videos we like, Netflix/YouTube can update our playlist, what links we
can click, and status we can react to; Facebook can recommend posts to us,
observing what type of product we frequently purchase; and Amazon can
suggest our next purchase as per our pocket size! Amazing, right?
The short definition for ML is as follows: “In Machine Learning, we
study statistical/mathematical algorithms to learn the patterns from the
data which are then used to make predictions for the future.”
And ML is not limited to the online mediums alone. Its power has been
extended to multiple domains, geographies, and use cases. We will be
describing those use cases in detail in the last section of this chapter.
2
Chapter 1 Introduction to Supervised Learning
So, in ML, we analyze vast amounts of data and uncover the patterns in it.
These patterns are then applied on real-world data to make predictions
for the future. This real-world data is unseen, and the predictions will help
businesses shape their respective strategies. We do not need to explicitly
program computers to do these tasks; rather, the algorithms take the
decisions based on historical data and statistical models.
But how does ML fit into the larger data analysis landscape? Often,
we encounter terms like data analysis, data mining, ML, and artificial
intelligence (AI). Data science is also a loosely used phrase with no
exact definition available. It will be a good idea if these terms are
explored now.
3
Chapter 1 Introduction to Supervised Learning
$XWRPDWLRQ6ROXWLRQV
$UWLILFLDO
,QWHOOLJHQFH
0DFKLQH
/HDUQLQJ
&ODVVLF 'DWD6FLHQFH
0DFKLQH/HDUQLQJ
'HHS
/HDUQLQJ
1HXUDO1HWZRUNV
Figure 1-1. Relationship between AI, ML, deep learning, and data
science shows how these fields are interrelated with each other and
empower each other
Deep learning is one of the hottest trends now. Neural networks are
the heart and soul of deep learning. Deep learning is a subset of AI and ML
and involves developing complex mathematical models to solve business
problems. Mostly we use neural networks to classify images and analyze
text audio and video data.
Data science lies at the juxtaposition of these various domains. It
involves not only ML but also statistics understanding, coding expertise
and business acumen to solve business problems. A data scientist’s job
is to solve business problems and generate actionable insights for the
business. Refer to Table 1-1 to understand the capabilities of data science
and its limitations.
4
Chapter 1 Introduction to Supervised Learning
Table 1-1. Data Science: How Can It Help Us, Its Usages, and
Limitations
How data science can help Limitations of data science
Assist in making decisions by analyzing multi
dimensional data which is quite difficult for a Data is not an alternative to experience
human being
Use statistical tools & techniques to uncover Data science cannot replace the subject matter
patterns knowledge
Data science depends on data availability and
The algorithms further help in measuring the
data quality. Depending on the input,we will get
accuracy of the patterns & the claims
the output
Data science will not increase the revenue or
The results are reproducible and can be improved sales or output by 50% overnight. Similarly, it will
not decrease the cost by 1/3 immediately
The machine learns, which is a big difference A data science project takes time to be
-from the traditional software engineering implemented
With the preceding discussion, the role of ML and its relationship with
other data-related fields should be clear to you. You would have realized by
now that “data” plays a pivotal role in ML. Let’s explore more about data,
its types and attributes.
5
Chapter 1 Introduction to Supervised Learning
6
Chapter 1 Introduction to Supervised Learning
A vital aspect often ignored and less discussed is data quality. Data
quality determines the quality of the analysis and insights generated.
Remember, garbage in, garbage out.
The attributes of a good dataset are represented in Figure 1-3.
While you are approaching a problem, it is imperative that you spend
a considerable amount of time ascertaining that your data is of the
highest quality.
7
Chapter 1 Introduction to Supervised Learning
8
Chapter 1 Introduction to Supervised Learning
9
Chapter 1 Introduction to Supervised Learning
10
Chapter 1 Introduction to Supervised Learning
Consider this: you want to automate the opening of a cola can. Using
software, you would code the exact steps with precise coordinates and
instructions. For that, you should know those precise details. However,
using ML, you would “show” the process of opening a can to the system
many times. The system will learn the process by looking at various steps
or “train” itself. Next time, the system can open the can itself. Now let’s
look at a real-life example.
Imagine you are working for a bank which offers credit cards. You
are in the fraud detection unit and it is your job to classify a transaction
as fraudulent or genuine. Of course, there are acceptance criteria like
transaction amount, time of transaction, mode of transaction, city of
transaction, and so on.
Let us implement a hypothetical solution using software; you might
implement conditions like those depicted in Figure 1-4. Like a decision
tree, a final decision can be made. Step 1: if the transaction amount is
below the threshold X, then move to step 2 or else accept it. In step 2,
the transaction time might be checked and the process will continue
from there.
11
Chapter 1 Introduction to Supervised Learning
However using ML, you will collect the historical data comprising past
transactions. It will contain both fraudulent and genuine transactions.
You will then expose these transactions to the statistical algorithm and
train it. The statistical algorithm will uncover the relationship between
attributes of the transaction with its genuine/fraud nature and will keep
that knowledge safe for further usage.
Next time, when a new transaction is shown to the system, it will
classify it fraudulent or genuine based on the historical knowledge it
has generated from the past transactions and the attributes of this new
unseen transaction. Hence, the set of rules generated by ML algorithms are
dependent on the trends and patterns and offer a higher level of flexibility.
Development of an ML solution is often more iterative than software
engineering. Moreover, it is not exactly accurate like software is. But ML is
a good generalized solution for sure. It is a fantastic solution for complex
business problems and often the only solution for really complicated
problems which we humans are unable to comprehend. Here ML plays a
pivotal role. Its beauty lies in the fact that if the training data changes, one
need not start the development process from scratch. The model can be
retrained and you are good to go!
So ML is undoubtedly quite useful, right! It is time for you to
understand the steps in an ML project. This will prepare you for a deeper
journey into ML.
M
L Projects
An ML project is like any other project. It has a business objective to be
achieved, some input information, tools and teams, desired accuracy
levels, and a deadline!
However, execution of an ML project is quite different. The very first
step in the ML process is the same, which is defining a business objective
and a measurable parameter for measuring the success criteria. Figure 1-5
shows subsequent steps in an ML project.
12
Chapter 1 Introduction to Supervised Learning
RIWKHWLPHJRHVWR'DWD'LVFRYHU\DQG'DWD3UHSDUDWLRQSKDVHDORQH
13
Another Random Scribd Document
with Unrelated Content
things was owing to the total want of the most ordinary common
sense on the part of the blinded authorities of the world. The period
would probably never arrive when the earth would be full; but, if it
should, the human race would be good, intelligent, and rational, and
would know much better than the present irrational generation how
to provide for the occurrence. Such was Owen’s socialistic treatment
of the population problem.
Robert Owen was essentially a pioneer, whose work and influence it
would be unjust to measure by their tangible results. Apart from his
socialistic theories, it should, nevertheless, be remembered that he
was one of the foremost and most energetic promoters of many
movements of acknowledged and enduring usefulness. He was the
founder of infant schools in England; he was the first to introduce
reasonably short hours into factory labour, and zealously promoted
factory legislation—one of the most needed and most beneficial
reforms of the century; and he was the real founder of the co-
operative movement. In general education, in sanitary reform, and in
his sound and humanitarian views of common life, he was far in
advance of his time. Like Fourier, also, he did the great service of
calling attention to the advantages which might be obtained in the
social development of the future from the reorganisation of the
commune, or self-governing local group of workers.
Still, he had many serious faults; all that was quixotic, crude, and
superficial in his views became more prominent in his later years,
and by the extravagance of his advocacy of them he did vital injury
to the cause he had at heart. In his personal character he was
without reproach—frank, benevolent, and straightforward to a fault;
and he pursued the altruistic schemes in which he spent all his
means with more earnestness than most men devote to the
accumulation of a fortune.
In England the reform of 1832 had the same effect as the revolution
of July (1830) in France: it brought the middle class into power, and
by the exclusion of the workmen emphasised their existence as a
separate class. The discontent of the workmen now found
expression in Chartism. As is obvious from the contents of the
Charter, Chartism was most prominently a demand for political
reform; but both in its origin and in its ultimate aim the movement
was more essentially economic. As regards the study of socialism,
the interest of this movement lies greatly in the fact that in its
organs the doctrine of ‘surplus value,’ afterwards elaborated by Marx
as the basis of his system, is broadly and emphatically enunciated.
While the worker produces all the wealth, he is obliged to content
himself with the meagre share necessary to support his existence,
and the surplus goes to the capitalist, who, with the king, the
priests, lords, esquires, and gentlemen, lives upon the labour of the
working man (Poor Man’s Guardian, 1835).
After the downfall of Owenism began the Christian socialist
movement in England (1848-52), of which the leaders were Maurice,
Kingsley, and Mr. Ludlow. The abortive Chartist demonstration of
April 1848 excited in Maurice and his friends the deepest sympathy
with the sufferings of the English working class—a feeling which was
intensified by the revelations regarding ‘London Labour and the
London Poor’ published in the Morning Chronicle in 1849. Mr.
Ludlow, who had in France become acquainted with the theories of
Fourier, was the economist of the movement, and it was with him
that the idea originated of starting co-operative associations.
In Politics for the People, in the Christian Socialist, in the pulpit and
on the platform, and in Yeast and Alton Locke, well-known novels of
Kingsley, the representatives of the movement exposed the evils of
the competitive system, carried on an unsparing warfare against the
Manchester School, and maintained that socialism, rightly
understood, was only Christianity applied to social reform. Their
labours in insisting on ethical and spiritual principles as the true
bonds of society, in promoting associations, and in diffusing a
knowledge of co-operation, were largely beneficial. In the north of
England they joined hands with the co-operative movement
inaugurated by the Rochdale pioneers in 1844 under the influence of
Owenism. Productive co-operation made very little progress, but co-
operative distribution soon proved a great success.
[1] Of R. Owen’s numerous works in exposition of his
system, the most important are the New View of
Society; the Report communicated to the
Committee on the Poor Law; the Book of the New
Moral World; and Revolution in the Mind and
Practice of the Human Race. See Life of Robert
Owen written by himself, London, 1857, and
Threading my Way, Twenty-seven Years of
Autobiography, by Robert Dale Owen, his son,
London, 1874. There are also Lives of Owen by A. J.
Booth (London, 1869), W. L. Sargant (London,
1860), and F. Podmore (London, 1906). For works
of a more general character see G. J. Holyoake,
History of Co-operation in England, London, 1875;
Adolf Held, Zwei Bücher zur socialen Geschichte
Englands, Leipsic, 1881.
CHAPTER V
FERDINAND LASSALLE
I. Life
[4]
Bastiat was the populariser in France of the
orthodox Political Economy. Lassalle accused
Schulze of being a mere echo of Bastiat’s superficial
views, and therefore called him Bastiat-Schulze.
II. Theories of Lassalle
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