Introduction To Machine Learning
Introduction To Machine Learning
MACHINE LEARNING
Outline
Topics:
• The Machine Learning Framework
• What is Supervised Learning?
• What is Unsupervised Learning?
Reading Material:
Chapter 18.2 to 14.2 in Russell & Norvig
Reference Videos:
• Machine Learning course by Andrew Ng, Coursera
− What is Machine Learning [video]
− Introduction – Supervised Learning [video]
− Introduction – Unsupervised Learning [video]
• The Machine Learning Pipeline by Evan Sparks [video]
Problems with Traditional Approach
Input
Output
Complex,
specific “car”
program
Will work if given the same image again, but, given the following new images, this
algorithm is expected to fail.
Problem:
- Static – cannot adapt to new input
- Complex – problem becomes unwieldy (many variations) 3
What is Machine Learning
4
The Machine Learning Framework
5
A Standard Machine Learning Pipeline
Training Phase: Testing Phase:
Data Preparation
Training
Input to
generates
Model
Predictions
Evaluation
6
Data Preparation
7
Feature extraction:
To automatically classify fishes (salmon or sea
brass) in a conveyor belt
Useful features: lightness, width, number of fins,
shape of the fins, shape of fish
Interested to know: classes of fishes in the
conveyor belt
9
Training
Width = 19.2
Lightness =
Width = 19.3 7.3
Lightness = 1.8
Sea Brass
Salmon
Width = 16.4
Lightness =
Width = 17.3 7.6
Lightness = 2.2
Sea Brass
Salmon
11
Testing
13
Categories of Machine Learning Techniques
Supervised Learning:
Learning a model from labeled data
Features
Label
length width weight
fruit 1 165 38 172 Banana
fruit 2 218 39 230 Banana
fruit 3 76 80 145 Orange
fruit 4 145 35 150 Banana
… … … … …
fruit 5 … … … …
Useful for tasks to predict the labels/values of a certain attribute of an input sample
(classification/regression tasks)
Example: Predict the type of a fruit (banana/orange) given its features (length, width and
weight)
Unsupervised Learning:
Sometimes, the labels are not available
Learning a model using features only without the labels
Useful for grouping similar samples into multiple groups (clustering)
Example: Given a group of fruits and their features (length, width, weight), cluster them into
different categories
14
Supervised Learning
Classification Regression
Classification predicts discrete Regression predicts continuous
valued output (e.g., present/not valued output (e.g., house price)
present)
Price (RM x1000)
Yes Yes 400
300
200
100
No No
0
Size
0 500 1000 1500 2000 2500
Digit Classification
• Input: images / pixel grids 0
• Output: a digit 0-9
• Setup: 1
− Get a large collection of example images, each labeled with a
digit
− Note: someone has to hand label all this data! 2
− Want to learn to predict labels of new, future digit images
• Features: 1
− The attributes used to make the digit decision
− Pixels: (6,8)=ON
− Shape Patterns: NumComponents, AspectRatio, NumLoops ??
− …
16
Classification: Example
17
Regression: Example
19
Unsupervised Learning
x1 x1
Learn the hypothesis function for the Discover the underlying structure,
task based on the features of the relationship or patterns based only
training samples and their labels. on the features of the training
sample 20
Example: News Search
21
Example: Gene clustering
Individuals
22
[Source: Daphne Koller]
Other Applications
23
When to apply machine learning?
24