01 - ML - Introduction (1)
01 - ML - Introduction (1)
Department of Economic
Mathematics
Machine Learning
Lecture 1. Overview of Machine Learning
2
Introduction
3
Source: Internet
Introduction
autonomous car
In healthcare 4
Source: Internet
AI
5
General AI vs Narrow AI
6
7
What is Machine Learning ?
8
What is Machine Learning ?
10
Example 1
Suppose your email program watches which emails you
do or do not mark as spam, and based on that learns how
to better filter spam.
11
Example 1
In Spam E-Mail detection,
Task, T: To classify mails into
Spam or Not Spam.
Performance measure, P: Total
percent of mails being correctly
classified as being “Spam” or “Not
Spam”. Spam
Experience, E: Set of Mails with No
?
Yes
label “Spam”
12
Why Use Machine Learning?
Consider how you would write a spam filter using:
Traditional programming techniques
17
Applications in banking / finance
18
Examples of Applications
Analyzing images of products on a production line to
automatically classify them
Detecting tumors in brain scans
Automatically classifying news articles
Automatically flagging offensive comments on
discussion forums
Summarizing long documents automatically
Creating a chatbot or a personal assistant
Forecasting your company’s revenue next year, based
on many performance metrics
Making your app react to voice commands
19
Examples of Applications
Detecting credit card fraud
Segmenting clients based on their purchases so that
you can design a different marketing strategy for each
segment
Representing a complex, high-dimensional dataset in
a clear and insightful diagram
Recommending a product that a client may be
interested in, based on past purchases
Building an intelligent bot for a game
20
How does Machine Learning work?
21
Ng, Frederick, Runqing Jiang, and James CL Chow. "Predicting radiation treatment planning evaluation parameter using artificial intelligence
and machine learning." IOP SciNotes 1.1 (2020): 014003.
CRISP-DM Methodology
Figure: A diagram of the CRISP-DM process which shows the six key phases 22
and indicates the important relationships between them [Wirth and Hipp, 2000].
Types of Machine Learning
23
Types of Machine Learning
Main ML algorithms:
Supervised
Unsupervised
Semi-supervised
Reinforcement Learning
24
SUPERVISED
LEARNING
25
Supervised learning
Typical tasks:
Classification
Regression
26
Supervised learning: classification
The spam filter:
Train: sample emails with their class / target (spam or ham)
Goal: learn how to classify new emails.
Objective:
learning the mapping 𝑓: 𝑿 → 𝒚
subject to 𝑦𝑖 ≈ 𝑓(𝐗𝐢) for all i = 1,…,n
Classification: 𝑦 is discrete
Regression: 𝑦 is continuous
29
Classification
30
Supervised learning: algorithms
k-Nearest Neighbors
Linear Regression
Logistic Regression
Support Vector Machines (SVMs)
Decision Trees and Random Forests
Neural networks
…
31
Scenario: You’re running a company, and you want to develop
learning algorithms to address each of two problems.
33
Unsupervised Learning
❖ Dataset: unlabels 𝑥(1) , … 𝑥 (𝑛)
❖ Typical tasks:
❖ Clustering
❖ Dimensionality reduction
❖ Anomaly detection
34
Unsupervised Learning: Clustering
38
SEMI-
SUPERVISED
LEARNING
39
Semi-supervised learning
Figure 1-11. Semisupervised learning with two classes (triangles and squares): the unlabeled
examples (circles) help classify a new instance (the cross) into the triangle class rather than
the square class, even though it is closer to the labeled squares
40
SELF- SUPERVISED
LEARNING
Goal: generate a fully labeled dataset from a fully unlabeled one.
41
Self-supervised learning
Figure 1-12. Self-supervised learning example: input (left) and target (right)
42
REINFORCEMEN
T LEARNING
• Reinforcement learning is a very different beast.
• The learning system, called an agent in this context, can observe the
environment, select and perform actions, and get rewards in return (or penalties
in the form of negative rewards).
• It learns by itself what is the best strategy, called a policy, to get the most
reward over time. A policy defines what action the agent should choose when it
is in a given situation
43
Reinforcement learning
45
Main Challenges of Machine Learning
3. Poor-Quality Data
Training data is full of errors, outliers, and noise
-> your system is less likely to perform well
Solutions:
• If some instances are clearly outliers, it may help to
simply discard them or try to fix the errors manually.
4. Irrelevant Features
Your system will only be capable of learning if the training data contains enough
relevant features and not too many irrelevant ones.
Solution:
Feature engineering:
• Feature selection
• Feature extraction
• Creating new features by gathering new data
5. Overfitting or Underfitting
50
Main Challenges of Machine Learning
5. Overfitting or Underfitting
Test error
Error
Training error
Underfitting
• Select a more powerful model, with more parameters.
• Feed better features to the learning algorithm (feature engineering).
• Reduce the constraints on the model (for example by reducing the
regularization hyperparameter)
52
Main Challenges of Machine Learning
Overfitting
Some solutions:
• Simplify the model by selecting one with fewer
parameters (e.g., a linear model rather than a high-
degree polynomial model), by reducing the
number of attributes in the training data, or by
constraining the model.
• Gather more training data.
• Reduce the noise in the training data (e.g., fix
data errors and remove outliers)
• Use validation set (or dev-set)
53
Main Challenges of Machine Learning
Learning algorithm
Under what conditions the chosen algorithm will
converge?
For a given application/domain and a given
objective function, what algorithm performs best?
No-free-lunch theorem [Wolpert and Macready, 1997]:
if an algorithm performs well on a certain class of
problems then it necessarily pays for that with
degraded performance on the set of all remaining
problems
Training data
How many observations are enough for learning?
Whether or not does the size of the training set
affect performance of an ML system?
What is the effect of the disrupted or noisy
observations?
55
Main Challenges of Machine Learning
Learnability:
The goodness/limit of the learning algorithm?
What is the generalization of the system?
o Predict well new observations, not only the training data.
o Avoid overfitting.
56
Overfitting: example
Increasing the size of a decision tree can degrade prediction on
unseen data, even though increasing the accuracy for the
training data.
[Mitchell, 1997] 57
Ethical and Social Considerations
59
Review Questions
60
Scenario 1: Credit Card Fraud Detection
61
Scenario 2: Customer Segmentation
You are a marketing analyst working for a retail company.
Your team wants to group customers into different segments
based on their purchasing behavior. You have a large dataset
containing customer purchase history, but it does not have
any pre-defined labels for segments.
A) Supervised Learning
B) Unsupervised Learning
C) Reinforcement Learning
D) Semi-Supervised Learning
62
Scenario 3: Anomaly Detection
As a cybersecurity analyst, your job is to detect network
intrusions and malicious activities. You have access to
log data from various network devices and systems.
Your objective is to identify abnormal patterns that might
indicate a potential security breach.
A) Supervised Learning
B) Unsupervised Learning
C) Reinforcement Learning
D) Semi-Supervised Learning
63
64
Thank you!
65