Professional Documents
Culture Documents
Fundamental
Theories
behind ML
Fundamental theories
behind Machine
Learning
1
21-03-2022
2
21-03-2022
Thomas Bayes, founded ideas that are essential in the probability theory that is manifested into Machine Learning.
3
21-03-2022
Probability Theory
• We live in a probabilistic world.
Everything that happens has
uncertainty attached to it.
• The Bayesian interpretation of
probability is what Machine Learning is
based upon.
• Bayesian probability means that we
think of probability as quantifying the
uncertainty of an event.
Probability Theory
• We have to base our probabilities on the
information available about an event,
rather than counting the number of
repeated trials.
• For example, when predicting a football
match, instead of counting the total
amount of times Manchester United
have won against Liverpool, a Bayesian
approach would use relevant
information such as the current form,
league placing and starting team.
• The benefit of taking this approach is that
probabilities can still be assigned to rare
events, as the decision-making process is
based on relevant features and reasoning.
4
21-03-2022
10
5
21-03-2022
11
Introduction to
Supervised
Learning
12
6
21-03-2022
Supervised learning
• Like human learning from past experiences.
• A computer does not have “experiences”.
• A computer system learns from data, which
represent some “past experiences” of an
application domain.
• Our focus: learn a target function that can be
used to predict the values of a discrete class
attribute, e.g., approve or not-approved, and
high-risk or low risk.
• The task is commonly called: Supervised
learning, classification, or inductive learning.
13
13
Supervised Learning
• In Supervised learning, you train the
machine using data which is
well "labelled." It means some data is
already tagged with the correct answer. It
can be compared to learning which takes
place in the presence of a supervisor or a
teacher.
• A supervised learning algorithm learns
from labelled training data, helps you to
predict outcomes for unforeseen data.
14
7
21-03-2022
Supervised Learning
• Here the human experts acts as the teacher
where we feed the computer with training
data containing the input/predictors and we
show it the correct answers (output) and from
the data the computer should be able to learn
the patterns.
• Supervised learning algorithms try to model
relationships and dependencies between the
target prediction output and the input
features such that we can predict the output
values for new data based on those
relationships which it learned from the
previous data sets.
15
Supervised learning
• Supervised learning is the machine
learning task of determining a function
from labeled data.
• For example, in a machine learning
algorithm that detects if a post is spam
or not, the training set would include
posts labeled as "spam" and posts
labeled as "not spam" to help teach the
algorithm how to recognize the
difference.
16
16
8
21-03-2022
Supervised learning
• Supervised learning algorithms infer a function from
labeled data and use this function on new examples.
• Since the algorithm receives a data set as input that
already has a correct answer associated with it, the
algorithm will learn by comparing its output with the
correct answer, and if it finds errors, it adjusts the model
accordingly.
• The training continues until the algorithm outputs
information within the desired accuracy range.
• The most widely used supervised learning algorithms
are
• support vector machines, linear regression, logistic
regression, k-nearest-neighbors, and neural
networks.
• Supervised learning is commonly used in situations
where historical data predicts likely future events.
17
17
18
9
21-03-2022
19
20
10
21-03-2022
How Supervised
Learning Works
• For example, you want to train a machine to help you
predict how long it will take you to drive home from
your workplace. Here, you start by creating a set of
labelled data. This data includes
• Weather conditions
• Time of the day
• Holidays
• All these details are your inputs. The output is the
amount of time it took to drive back home on that
specific day.
• You instinctively know that if it's raining outside, then
it will take you longer to drive home. But the machine
needs data and statistics.
21
22
11
21-03-2022
Supervised learning
process: Two steps
23
23
24
12
21-03-2022
25
26
13
21-03-2022
27
Classification
28
14
21-03-2022
Regression
29
Regression
30
15
21-03-2022
Classification
vs
Regression
31
36
16
21-03-2022
Practical
Examples of
Supervised
Learning
37
Practical examples of
Supervised Learning
38
17
21-03-2022
Ex 1: Hospital bed
allocation
• An emergency room in a hospital
measures 17 variables (e.g., blood
pressure, age, etc.) of newly admitted
patients.
• A decision is needed: whether to put a
new patient in an intensive-care unit.
• Due to the high cost of ICU, those
patients who may survive less than a
month are given higher priority.
• Problem: to predict high-risk patients
and discriminate them from low-risk
patients.
39
40
40
18
21-03-2022
Approved or not
An example:
data (loan
application)
41
41
An example: the
learning task
• Learn a classification model from the
data
• Use the model to classify future loan
applications into
• Yes (approved) and
• No (not approved)
• What is the class for following
case/instance?
42
42
19
21-03-2022
Ex 3: Spam filtering of
emails
• We all use Gmail, Yahoo, or Outlook.
Machine learning algorithms are used
for deciding which email is spam and
which is not.
• Based on the previous data like received
emails, data that we use etc., the
system makes predictions about an
email as for whether it is a spam or not.
• These predictions may not be perfect,
but they are accurate most of the times.
43
43
44
20
21-03-2022
47
Introduction to
Unsupervised
Learning
48
21
21-03-2022
Unsupervised Learning
• Unsupervised learning is a machine learning technique, where
you do not need to supervise the model. Instead, you need to
allow the model to work on its own to discover information.
49
Example of • Let's, take the case of a baby and her family dog.
Unsupervised • She knows and identifies this dog. Few weeks later a family
Machine Learning friend brings along a dog and tries to play with the baby.
50
22
21-03-2022
Example of Unsupervised
Machine Learning
• Baby has not seen this dog earlier. But it
recognizes many features (2 ears, eyes, walking
on 4 legs) are like her pet dog.
51
Puppy or
Muffin?
Progress in
Image
Recognition
52
52
23
21-03-2022
53
54
24
21-03-2022
55
56
25
21-03-2022
57
57
58
26
21-03-2022
59
60
27
21-03-2022
Types of Unsupervised
Learning
61
Clustering
62
28
21-03-2022
Clustering
63
64
29
21-03-2022
65
Association
• Association rules allow you to establish
associations amongst data objects inside large
databases.
• This unsupervised technique is about discovering
interesting relationships between variables in
large databases.
• For example, people that buy a new home most
likely to buy new furniture.
66
30
21-03-2022
Association
Examples:
• A subgroup of cancer patients grouped by their
gene expression measurements
• Groups of shopper based on their browsing
and purchasing histories
• Movie group by the rating given by movies
viewers
67
68
31
21-03-2022
69
Practical
Examples of
Unsupervised
Learning
70
32
21-03-2022
Examples of Unsupervised
Learning
71
72
33
21-03-2022
Customer
Segmentation
• Clustering is commonly used for
determining customer segments in
marketing data.
• Being able to determine different segments
of customers helps marketing teams
approach these customer segments in
unique ways.
• Think of features like gender, location, age,
education, income bracket, and so on.
73
Dimensionality reduction -
Reducing the complexity of a
problem
74
34
21-03-2022
Anomaly Detection
75
AirBnB
76
35
21-03-2022
Amazon
77
Market basket
analysis
• The algorithm identifies
typical patterns of purchases
and jointly purchased goods.
• The results obtained allow
optimizing the assortment
and its placement in the
sales areas, improving stock
management, increasing
sales volumes by offering
related products to
customers.
78
36
21-03-2022
Applications in
Marketing
• Cross-selling and up-selling. Based
on behavioral patterns, the
algorithm allows you to identify
customers who are inclined to
respond to personalized offers and
cross-selling.
• Direct mail – direct targeted
mailing that promotes offers to
potential and existing customers.
It is a highly effective, simple, and
cheap marketing tool.
79
Summary Unsupervised
Learning
80
37
21-03-2022
To summarize
• Unsupervised learning is a machine learning technique, where you do not need to supervise the
model.
• Unsupervised machine learning helps you to finds all kind of unknown patterns in data.
• Clustering and Association are two types of Unsupervised learning.
• Association rules allow you to establish associations amongst data objects inside large databases.
• In Supervised learning, Algorithms are trained using labelled data while in Unsupervised learning
Algorithms are used against data which is not labelled.
• Anomaly detection can discover important data points in your dataset which is useful for finding
fraudulent transactions.
• The biggest drawback of Unsupervised learning is that you cannot get precise information
regarding data sorting.
81
82
38
21-03-2022
83
Reinforcement
Learning
Approach
84
39
21-03-2022
85
86
40
21-03-2022
87
Reinforcement Learning
• Imagine a baby is given a TV remote
control at your home (environment).
88
41
21-03-2022
Reinforcement Learning
89
90
42
21-03-2022
91
92
43
21-03-2022
93
Reinforcement Learning
• From self-improving cars which tend to
perform RL with safety and precision, this
technology can also be used for robots
(without using manual programming) and
can figure out the configuration required for
the apparatus in a data center.
• Other players in RL are Mobileye, OpenAI,
Google, and Uber. Google and DeepMind
also worked together to make its center’s
energy efficient.
• This was made possible through an RL
algorithm which can study from assembled
data, experiment through stimulation and
finally suggest when and how the cooling
systems must be operated.
94
44
21-03-2022
Applications in self-
driving cars
• Various papers have proposed Deep Reinforcement Learning for
autonomous driving. In self-driving cars, there are various aspects to
consider, such as speed limits at various places, drivable zones, avoiding
collisions.
• Some of the autonomous driving tasks where reinforcement learning could
be applied include trajectory optimization, motion planning, dynamic
pathing, controller optimization, and scenario-based learning policies for
highways.
• For example
• Parking can be achieved by learning automatic parking policies.
• Lane changing can be achieved using Q-Learning while overtaking can
be implemented by learning an overtaking policy while avoiding
collision and maintaining a steady speed thereafter.
95
Applications in
self-driving cars
• AWS DeepRacer is an
autonomous racing car that has
been designed to test out RL in a
physical track.
• It uses cameras to visualize the
runway and a reinforcement
learning model to control the
throttle and direction.
96
45
21-03-2022
Reinforcement Learning
applications in trading and finance
• Supervised time series models can be used for predicting future sales
as well as predicting stock prices. However, these models don’t
determine the action to take at a particular stock price.
• Enter Reinforcement Learning (RL). An RL agent can decide on such a
task; whether to hold, buy, or sell. The RL model is evaluated using
market benchmark standards in order to ensure that it’s performing
optimally.
• This automation brings consistency into the process, unlike previous
methods where analysts would have to make every single decision.
• IBM for example has a sophisticated reinforcement learning based
platform that has the ability to make financial trades. It computes the
reward function based on the loss or profit of every financial
transaction.
97
Reinforcement Learning in
news recommendation
• User preferences can change frequently, therefore
recommending news to users based on reviews and likes could
become obsolete quickly. With reinforcement learning, the RL
system can track the reader’s return behaviours.
• Construction of such a system would involve obtaining news
features, reader features, context features, and reader news
features. News features include but are not limited to the
content, headline, and publisher.
• Reader features refer to how the reader interacts with the
content e.g clicks and shares. Context features include news
aspects such as timing and freshness of the news. A reward is
then defined based on these user behaviours.
98
46
21-03-2022
99
To Summarize
100
47
21-03-2022
101
48