0% found this document useful (0 votes)
27 views35 pages

Lec 1

The document provides an introduction to a machine learning course. It outlines the course contents which include fundamental machine learning algorithms and performance issues. It also discusses different types of machine learning like supervised learning, unsupervised learning and reinforcement learning.

Uploaded by

kiuclairdelune
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views35 pages

Lec 1

The document provides an introduction to a machine learning course. It outlines the course contents which include fundamental machine learning algorithms and performance issues. It also discusses different types of machine learning like supervised learning, unsupervised learning and reinforcement learning.

Uploaded by

kiuclairdelune
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

EE2211 Introduction to

Machine Learning
Lecture 1

Wang Xinchao
[email protected]

Office Hour: Wed 9:30 – 10:30 AM


(Week 2-4, Week 10-12)
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Course Contents
• Introduction and Preliminaries (Xinchao)
– Introduction
– Data Engineering
– Introduction to Probability and Statistics
• Fundamental Machine Learning Algorithms I (Helen)
– Systems of linear equations
– Least squares, Linear regression
– Ridge regression, Polynomial regression
• Fundamental Machine Learning Algorithms II (Helen)
– Over-fitting, bias/variance trade-off
– Optimization, Gradient descent
– Decision Trees, Random Forest
• Performance and More Algorithms (Xinchao)
– Performance Issues
– K-means Clustering
– Neural Networks
2
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
World’s Largest Selfie

3
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
World’s Largest Selfie

4
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Outline
• What is machine learning?
– Three Definition(s)
• When do we need machine learning?
– Sometimes we need, sometimes we don’t
• Applications of machine learning
• Types of machine learning
– Supervised, Unsupervised, Reinforcement Learning
• Walking through a toy example on classification
• Inductive vs. Deductive Reasoning

5
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
What is machine learning?

Learning is any process by which a system


improves performance from experience.
- Herbert Simon

A computer program is said to learn


- from experience E
- with respect to some class of tasks T
- and performance measure P,
if its performance at tasks in T, as measured
by P, improves with experience E.
- Tom Mitchell
6
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Machine Learning (Supervised Learning)
Learned
Data
Computer Function 𝑓 .
Output

Data Output

Cat 𝑓( ) = ‘cat’
𝑓(. ) such that

𝑓( )= ‘dog’
Dog

7
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Machine Learning (Supervised Learning)
Learned
Data
Computer Function 𝑓 .
Output

Data Output

When applied
Cat

𝑓(. ) 𝑓( ) Cat!

New image
Dog

Machine Learning: field of study that gives computers the


ability to learn without being explicitly programmed
- Arthur Samuel

8
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
AI, Machine Learning, and
Deep Learning

Example of AI but not ML: Deductive Reasoning

NUS is in Singapore, Singapore is in Asia -> NUS is in Asia

9
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
• Human expertise does not exist (navigating on Mars)
When
• Humans do can’t
we explain
need their
machine
expertiselearning?
(speech recognition)
• Models must be customized (personalized medicine)
Lack of human expertise Involves huge amount of data
Modelsonare
•(Navigating based
Mars) on huge amounts of data (genomics)
(Genomics)

Learning isn’t
Learning is not always
always useful:
useful:
• NoThere is no need to “learn” to calculate payroll
need to “learn” to calculate payroll!
5
Based on slide by E. Alpaydin
My Salary = Days_of_work * Daily Salary + Bonus

10
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Application of Machine Learning
A classic example of a task that requires machine learn
Task T, Performance P, Experience E
It is very hard to say what makes a 2

T: Digit Recognition
P: Classification Accuracy
E: Labelled Images

“four”
“three”

Labels -> Supervision!


Slide credit: Geoffrey Hinton

11
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Application of Machine Learning

Task T, Performance P, Experience E

T: Email Categorization
P: Classification Accuracy
E: Email Data, Some Labelled

12
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Application of Machine Learning

Task T, Performance P, Experience E

T: Playing Go Game
P: Chances of Winning
E: Records of Past Games

13
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Application of Machine Learning

Task T, Performance P, Experience E

T: Identifying Covid-19 Clusters


P: Small Internal Distances
Larger External Distances
E: Records of Patients

14
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Web Search Engine Product Recommendation Language Translation

Photo Tagging Virtual Personal Assistant Portfolio Management

Traffic Prediction Medical Diagnosis


Algorithmic Trading
15
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Types of Machine Learning

Supervised Learning Unsupervised Learning Reinforcement Learning


Input: Input:
1) Training Samples, Input: Sequence of States,
2) Desired Output Samples Actions, and
(Teacher/Supervision) Delayed Rewards
Output:
Output: Underlying patterns in Output:
A rule that maps input to data Action Strategy: a rule
output that maps the
environment to action

16
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Types of Machine Learning

Supervised Learning Unsupervised Learning Reinforcement Learning


Input: Input:
1) Training Samples, Input: Sequence of States,
2) Desired Output Samples Actions, and
(Teacher/Supervision) Delayed Rewards
Output:
Output: Underlying patterns in Output:
A rule that maps input to data Action Strategy: a rule
output that maps the
environment to action

17
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Supervised Data Output

Learning 𝑥 Regression 𝑦 (Continuous)

𝑥 Classification 𝑦 (Categorical)

• Given 𝐱!, 𝑦! , 𝐱 ", 𝑦" , …, 𝐱 # , 𝑦#


Regression • Learn a function 𝑓 𝐱 to predict real-valued 𝑦 given 𝐱

Arctic Sea Ice Extent in January (in million sq km) Acrtic Sea Ice Extent in January (in million sq km)
16 16

15.5 15.5

15 15

𝑦 14.5
𝑦
14.5
𝑓 𝑥 : line that best aligns
14 14 with samples
13.5 13.5

13 13

12.5 12.5
1970 1980 1990 2000 2010 2020 2030 1970 1980 1990 2000 2010 2020 2030

𝑥 𝑥

18
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Supervised Data Output

Learning 𝑥 Regression 𝑦 (Continuous)

𝑥 Classification 𝑦 (Categorical)

• Given 𝐱!, 𝑦! , 𝐱 ", 𝑦" , …, 𝐱 # , 𝑦#


Classification • Learn a function 𝑓 𝐱 to predict categorical 𝑦 given 𝐱

width width
𝑦 = Sea Bass 𝑦 = Sea Bass
Feature 𝐱! 𝐱!
Space
𝐱" 𝐱" ?

𝑦 = Salmon 𝑦 = Salmon
lightness lightness
𝑓 𝑥 : line that separates
two classes
19
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Types of Machine Learning

Supervised Learning Unsupervised Learning Reinforcement Learning


Input: Input:
1) Training Samples, Input: Sequence of States,
2) Desired Output Samples Actions, and
(Teacher/Supervision) Delayed Rewards
Output:
Output: Underlying patterns in Output:
A rule that maps input to data Action Strategy: a rule
output that maps the
environment to action

20
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Unsupervised Learning

• Given 𝐱!, 𝐱 ", …, 𝐱 # , without labels


Clustering • Output Hidden Structure Behind

width width
𝐱! 𝐱!

𝐱" 𝐱"

lightness lightness

21
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Types of Machine Learning

Supervised Learning Unsupervised Learning Reinforcement Learning


Input: Input:
1) Training Samples, Input: Sequence of States,
2) Desired Output Samples Actions, and
(Teacher/Supervision) Delayed Rewards
Output:
Output: Underlying patterns in Output:
A rule that maps input to data Action Strategy: a rule
output that maps the
environment to action

22
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Reinforcement Learning
Breakout Game

Initial Performance Training 15 minutes Training 30 minutes

23
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Reinforcement Learning
• Given sequence of states 𝑺 and actions 𝑨 with (delayed)
rewards 𝑹
• Output a policy 𝜋(𝑎, 𝑠), to guide us what action 𝑎 to take in
state 𝑠

𝑺: Ball Location,
Paddle Location, Bricks

𝑨: left, right

𝑹:
positive reward
Knocking a brick,
clearing all bricks

negative reward
Missing the ball

zero reward
Cases in between

24
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Supervised
Unsupervised Quiz Time!
Reinforcement
A classic example of a task that requires machine learning:
It is very hard to say what makes a 2

6
Slide credit: Geoffrey Hinton

Supervised Unsupervised

Supervised
Reinforcement

25
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification

? Yes

?
Yes No

Step1: Feature Extraction Step2: Sample Classification


Extract Attributes of Samples Decide Label for a Sample

26
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification
B,L,Ring R,L,Triangle
B,L,Rectangle
Y,S,Arrow

? Yes

G,S,Circle
G,S,Diamond ?
R,L,Circle
Y,L,Triangle
O,L,Diamond No
Yes

Step 1: Feature Extraction


Color, Size, Shape

27
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification

Feature Extraction
Color Size Shape Label
Blue Large Ring Yes
Red Large Triangle Yes
Orange Large Diamond Yes
Green Small Circle Yes
Yellow Small Arrow No
Blue Large Rectangle No
Red Large Circle No
Green Small Diamond No
Yellow Large Triangle ?

28
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification

Feature Extraction
Color Size Shape Label
Blue Large Ring Yes
Red Large Triangle Yes
Orange Large Diamond Yes
Green Small Circle Yes
Yellow Small Arrow No
Blue Large Rectangle No
Red Large Circle No
Green Small Diamond No

29
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification

Feature Extraction Similarity


Color Size Shape Label Color Size Shape Total
Blue Large Ring Yes 0 1 0 1
Red Large Triangle Yes 0 1 1 2
Orange Large Diamond Yes 0 1 0 1
Green Small Circle Yes 0 0 0 0
Yellow Small Arrow No 1 0 0 1
Blue Large Rectangle No 0 1 0 1
Red Large Circle No 0 1 0 1
Green Small Diamond No 0 0 0 0

30
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification

Similarity
Color Size Shape Total
Nearest Neighbor Classifier:
0 1 0 1
0 1 1 2 1) Find the “nearest
0 1 0 1 neighbor” of a sample in
the feature space
0 0 0 0
1 0 0 1 2) Assign the label of the
0 1 0 1 nearest neighbor to the
sample
0 1 0 1
0 0 0 0

31
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Inductive vs. Deductive Reasoning
• Main Task of Machine Learning: to make inference
Two Types of Inference

Inductive Deductive

• To reach logical conclusions


• To reach probable conclusions deterministically
• Not all needed information is • All information that can lead to
available, causing uncertainty the correct conclusion is
available

Probability and Statistics Rule-based reasoning

NUS is in Singapore, Singapore is in Asia ->


NUS is in Asia

32
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Inductive Reasoning
Note: humans use inductive reasoning all the time and
not in a formal way like using probability/statistics.

Ref: Gardener, Martin (March 1979). "MATHEMATICAL GAMES: On the fabric of


inductive logic, and some probability paradoxes" (PDF). Scientific American. 234
33
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Summary by Quick Quiz

Three Components in ML Definition


Task T, Performance P, Experience E

Two Types of Supervised Learning


Classification, Regression
Three Types of in ML
Supervised Learning
Unsupervised Learning
One Type of Unsupervised Learning
Reinforcement Learning
Clustering

Inductive and Deductive


Example of a Classifier Model
Inductive: Probable Nearest Neighbor Classifier
Deductive: Rule-based

34
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
35
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"

You might also like