Learning from Data
Learning sensors actuators environment agent ? As an agent interacts with the world, it should learn about its environment
APPLE APPLE BANANA BANANA APPLE Supervised learning: given labeled data…
Supervised Learning APPLE or BANANA? …learn to classify (label) new example
Unsupervised Learning Unsupervised learning: Given unlabeled data…
Unsupervised Learning …put examples into groups (Clustering)…
Unsupervised Learning ? Given new example, put it into a group.
Focus on Supervised Learning first… Given previous data, how can we “learn” to classify new data?
APPLE APPLE BANANA BANANA APPLE or BANANA? APPLE
Training Training Set
Training Training Set Extract features/ labels
Training Training Set Extract features/ labels Train
Learned model/ Classifier Training Learned model/ Classifier Training Set Extract features/ labels Train
Learned model/ Classifier Training Learned model/ Classifier Training Set Extract features/ labels Train Classifying Instance/Example
Learned model/ Classifier Training Learned model/ Classifier Training Set Extract features/ labels Train Classifying Instance/Example Extract features
Training Classifying Learned model/ Classifier Training Set Extract features/ labels Train Classifying Learned model/ Classifier Instance/Example Extract features
Training Classifying Learned model/ Classifier Training Set Extract features/ labels Train Classifying Learned model/ Classifier Label Instance/Example Extract features
Inductive Learning Generalize (learn) from a training set to make predictions on future test sets.
Inductive Learning Generalize (learn) from a training set to make predictions on future test sets. Supervised Learning: Training data is a set of (x, y) pairs x: input example/instance y: output/label Learn an unknown function f such that f(x)=y
Inductive Learning Generalize (learn) from a training set to make predictions on future test sets. Supervised Learning: Training data is a set of (x, y) pairs x: input example/instance y: output/label Learn an unknown function f(x)=y x represented by D-dimensional feature vector x = < x1 , x2 , x3 ,…, xD > Each dimension is a feature or attribute
Some examples image classification text classification does the image contain a person? apple? banana? text classification is this a good/bad review? is this article about sports or politics? is this e-mail spam? character recognition is this set of scribbles an ‘a’, ‘b’, ‘c’, … credit card transactions fraud or not? Many problems!!!
Another example Database of 20,000 images of handwritten digits, each labeled by a human This is perhaps the most well-studied data set in ML… handwritten digits, part of zipcodes scanned off envelopes by the post office. Use these to train a classifier which will label digit-images
Another example Database of 20,000 images of handwritten digits, each labeled by a human This is perhaps the most well-studied data set in ML… handwritten digits, part of zipcodes scanned off envelopes by the post office. Each image is of size 28x28 pixels. Labels are 0-9. Features?
Another example Database of 20,000 images of handwritten digits, each labeled by a human This is perhaps the most well-studied data set in ML… handwritten digits, part of zipcodes scanned off envelopes by the post office. Features are RGB values for each pixel 28x28 features, values ranging from 0 to 255
Wait for a Table? An intelligent agent that tells us if we should wait for a table at a restaurant How to apply supervised learning here?
Wait for a Table? An intelligent agent that tells us if we should wait for a table at a restaurant How to apply supervised learning here? What features should we consider?
Wait for a table? Alternate restaurant nearby? Comfy bar to wait at? Is it Friday? How hungry are we? How full is it? How expensive is it? What’s the weather like? Do we have reservations? Type of food? Estimated wait time? Features/Attributes
Wait for a Table?
Wait for a Table? How to organize/visualize this data? (Note that each attribute has a finite set of possibilities)
Alternate Restaurant. T or F Bar. T or F How full Alternate Restaurant? T or F Bar? T or F How full? Some, Full, pr None Prince? $, $$, $$$, or $$$$ Estimated Wait Time: 0-10, 10-30, 30-60, >60
All examples with Patrons=None were No Patrons = Some were Yes Examples with Patrons = Full depended on other features
Decision Trees
How to classify new example? All examples with Patrons=None were No Patrons = Some were Yes Examples with Patrons = Full depended on other features
How to classify new example? All examples with Patrons=None were No Patrons = Some were Yes Examples with Patrons = Full depended on other features
Classifying a New Example