Professional Documents
Culture Documents
Machine Learning
Lecture 1
Wang Xinchao
xinchao@nus.edu.sg
!"#$%&'()*+",,-"./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 (Thomas)
– 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?
• When do we need machine learning?
• Applications of machine learning
• Types of machine learning
• Walking through a toy example on classification
• Inductive vs. Deductive Reasoning
5
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
What is machine learning?
Traditional Approach
Data
Computer Output
Program
Hard-coded
Machine Learning
Data
Computer Program
Output Learned
7
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
AI, Machine Learning, and
Deep Learning
8
!"#$%&'()*+",,-"./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 Models must be customized
Modelsonare
•(Navigating based
Mars) on huge amounts
(Personalized of data (genomics)
Medicine)
9
!"#$%&'()*+",,-"./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
10
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Application of Machine Learning
T: Email Categorization
P: Classification Accuracy
E: Email Data, Some Labelled
11
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Application of Machine Learning
T: Playing Go Game
P: Chances of Winning
E: Records of Past Games
12
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Application of Machine Learning
13
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Web Search Engine Product Recommendation Language Translation
15
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Types of Machine Learning
16
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Supervised output
Learning % Regression # (Continuous)
% Classification # (Categorical)
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
% %
17
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Supervised
Learning % Regression # (Continuous)
% Classification # (Categorical)
width width
# = Sea Bass # = Sea Bass
Feature !! !!
Space
!" !" ?
# = Salmon # = Salmon
lightness lightness
$ % : line that separates
two classes
18
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Types of Machine Learning
19
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Unsupervised Learning
!! !!
!" !"
20
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Types of Machine Learning
21
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Reinforcement Learning
Breakout Game
22
!"#$%&'()*+",,-"./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
23
!"#$%&'()*+",,-"./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
24
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification
? Yes
?
Yes No
25
!"#$%&'()*+",,-"./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 testingsample
26
!"#$%&'()*+",,-"./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 ?
27
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Walking Through A Toy Example:
Token Classification
29
!"#$%&'()*+",,-"./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
30
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
Inductive vs. Deductive Reasoning
• Main Task of Machine Learning: to make inference
Two Types of Inference
Inductive Deductive
31
!"#$%&'()*+",,-"./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.
33
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"
34
!"#$%&'()*+",,-"./01"233"4()*+5"4656'7681"