Machine Learning
1
Textbook:
Géron, A. (2019). Hands-On Machine Learning with Scikit-Learn and
Tensorflow: Concepts, Tools, and Techniques to Build Intelligent Systems (2nd
ed.). O'Reilly Media.
Rough grade breakdown:
average of 3 Midterm (50%) + Final (50%)
midterm 1 (week 7: 30/09/2024 - 05/10/2024)
midterm 2 (week 10), midterm 3 (week 13)
Final = Homework (50%) + Report (50%)
All midterm tests are online quizzes on https://utex.hcmute.edu.vn/
2
2
1
Contents:
1. Overview
2. Classification
3. Regression
4. Clustering
3
3
Overview of
Machine Learning
4
2
What is Machine Learning?
Machine learning is a subset of artificial intelligence that involves
the development of algorithms and statistical models that enable
computers to learn from and make predictions or decisions based
on data without being explicitly programmed.
In other words, machine learning allows computers to analyze and
interpret large amounts of data to identify patterns and make
informed decisions or predictions.
It is widely used in various fields such as healthcare, finance,
marketing, and more to automate tasks, improve efficiency, and
make data-driven decisions.
5
5
Learning association
By analyzing customer buying patterns, we can target potential
customers for cross-selling.
Our goal is to determine the conditional probability P(Y|X), where Y
represents the product we want to base on X, the product or
products that we are aware the customer has already bought.
6
6
3
Classification
Credit scoring is an example of a classification problem where there
are two classes: low-risk and high-risk customers. The information
about a customer makes up the input to the classifier whose task is
to assign the input to one of the two classes.
After training with the past data, a classification rule learned may be
of the form:
IF income> 1 AND savings> 2 THEN low-risk ELSE high-risk
for suitable values of 1 and 2 .
This is an example of a discriminant; it is a function that separates
the examples of different classes.
7
7
Classification
Example of a training dataset with two customer attributes
(income and savings) as input. Each circle represents a data instance,
with its sign indicating the class (low-risk '+' or high-risk '-’).
A discriminant that separates the two classes is also displayed.
8
8
4
Classification
We can see classification as learning an association from X to Y.
Then for a given X = x, if we have P(Y = 1 l X = x) = 0.8, we say that
the customer has an 80 percent probability of being high-risk, or
equivalently a 20 percent probability of being low-risk. We then
decide whether to accept or refuse the loan depending on the
possible gain and loss.
9
9
Classification
Machine learning is widely used in pattern recognition, such as
optical character recognition, where character codes are identified
from images.
Handwritten characters pose a challenge due to variations in style,
size, and writing tools.
By analyzing samples and extracting common features, machine
learning algorithms can learn to recognize characters accurately,
even without a formal description of each character.
This process involves capturing the regularity and patterns in
character images to improve recognition accuracy.
10
10
5
Classification
In face recognition, the program learns to associate face images
with identities, facing challenges like pose and lighting variations.
Medical diagnosis involves classifying illnesses based on patient
information, including age, gender, medical history, and symptoms.
Some tests may be omitted to avoid inconvenience, and incorrect
decisions can impact treatment. When uncertain, it's best for the
classifier to defer to a human expert.
11
11
Classification
Speech recognition involves associating acoustic signals with spoken
words. Variations in pronunciation due to factors like age, gender,
and accent make this task challenging.
Additionally, speech input is temporal, with words being uttered as
a sequence of phonemes, some longer than others.
Machine learning can also be used for outlier detection, identifying
instances that do not conform to the established rule. These outliers
may indicate anomalies, such as fraud, that require further
investigation.
12
12
6
Regression
Problem: Predict the price of a used car
Let X denote the car attributes and Y be the price of the car. Again
surveying the past transactions, we can collect a training data and
the machine learning program fits a function to this data to learn Y
as a function of X.
An example is given where the fitted function is of the form
y = wx + wo
for suitable values of w and wo
13
13
Regression
Both regression and classification are supervised learning problems
where there is an input, X, an output, Y, and the task is to learn the
mapping from the input to the output. The approach in machine
learning is that we assume a model defined up to a set of parameters:
y = g(x l )
where g () is the model and are its parameters.
The machine learning program optimizes the parameters, , such that
the approximation error is minimized, that is, our estimates are as
close as possible to the correct values given in the training set.
14
14
7
Regression
In cases where the linear model is too restrictive, one can use for
example a quadratic
y = w 2 x 2 + w 1x + w o
Or a higher-order polynomial, or any other nonlinear function of the
input, this time optimizing its parameters for best fit
15
15
Unsupervised Learning
Supervised learning involves learning a mapping from input to output
with provided correct values, while unsupervised learning aims to find
regularities in input data without a supervisor.
Clustering is a method for density estimation, grouping similar inputs
together. In business, clustering can be used for customer
segmentation, identifying customer groups for targeted strategies.
Clustering is also used in image compression to group similar pixels
together, reducing storage needs while maintaining image quality.
By identifying patterns in data, clustering can provide a simpler and
more efficient description of the data, leading to better compression
results.
16
16
8
Unsupervised Learning
Document clustering groups similar documents based on shared
words in a predefined lexicon.
Machine learning methods are used in bioinformatics to align DNA
and protein sequences, with motifs representing recurring amino acid
sequences in proteins. Motifs can indicate structural or functional
elements within protein sequences.
17
17
Reinforcement learning
Reinforcement learning algorithms are used in applications where the
output is a sequence of actions, focusing on the overall policy rather
than individual actions.
These algorithms assess the goodness of policies and learn from past
successful action sequences to generate effective policies.
Game playing and robot navigation are common examples of
reinforcement learning applications.
Challenges arise when dealing with unreliable sensory information or
coordinating multiple agents to achieve a common goal, such as in a
team of robots playing soccer.
18
18
9
Methodology: insight-driven
70% – 90% the whole process
19
19
Methodology: product-driven
70% – 90% the whole process
20
20
10
Product development: experience
21
21
Overfitting
Overfitting in machine learning refers to a situation where a
machine learning model performs well on the training data but fails
to generalize to new, unseen data.
This occurs when the model learns the noise and random
fluctuations in the training data rather than the underlying patterns.
As a result, the model may make inaccurate predictions when
presented with new data.
Overfitting can be a significant issue in machine learning, as it can
lead to poor performance and unreliable results.
Techniques such as cross-validation, regularization, and early
stopping can help prevent overfitting in machine learning models.
22
22
11
THANK YOU!
23
23
12