Introduction to Machine Learning
Maggie Makar
Presidential Postdoctoral Fellow/Assistant Professor
Electrical Engineering and Computer Science
My work: clinical decision support through…
Prediction
Does this X-ray show signs of Pneumonia?
Causal inference
Will chemotherapy extend the patient’s life expectancy?
Start treatment
Chemo
No action
Palliative care
Does this X-ray show signs of Pneumonia?
Will chemotherapy extend the patient’s life expectancy?
Yes
No
Yes
No
What is Machine learning?
The study of patterns to create rules that generalize
What is Machine learning?
The study of patterns to create rules that generalize
What is not Machine learning?
Artificial Intelligence
Machine learning
What is Machine learning?
The study of patterns to create rules that generalize
What is not Machine learning?
Artificial Intelligence
Machine learning
“Prescribed” rules
E.g., Boolean and Fuzzy logic
If rice is brown and heat is 100 🡪 stop
If rice is white and heat is 100 🡪 lower heat
What is Machine learning?
The study of patterns to create rules that generalize
What is not Machine learning?
Artificial Intelligence
Machine learning
“Prescribed” rules
Learned rules
E.g., Boolean and Fuzzy logic
Don’t know what the rule is, but we try to ”learn” it from data
If rice is brown and heat is 100 🡪 stop
If rice is white and heat is 100 🡪 lower heat
Types of Machine Learning
Types of Machine Learning
Types of Machine Learning
Types of Machine Learning
Supervised learning: setup
Input: Labeled data
Supervised learning: setup
Input: Labeled data
Regression:
Binary classification:
Multiclass-Classification:
Supervised learning: setup
Input: Labeled data
Goal: learn a mapping h:
Regression:
Binary classification:
Multiclass-Classification:
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
Age
Income
Space of linear hypotheses
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
Age
Education
Age
Education
Space of linear hypotheses
Space of decision-tree based hypotheses
Age
Income
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
How good is a prediction?
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
How good is a prediction?
Regression problems
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
How good is a prediction?
Regression problems
Binary Classification (0/1)
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
How good is a prediction?
Regression problems
Binary Classification (0/1)
How good is a hypothesis?
Picking a hypothesis (mapping)
Define a hypothesis class,
Define evaluation criteria
Define a learning algorithm
What makes an ML model good?
For an unobserved dataset of size m, want low:
As a proxy, we will minimize:
🡪Empirical risk minimization
Warning!
Minimizing training loss is an imperfect proxy. �Will minimizing the training loss give us a good model if we consider the memorization hypothesis?
A regression problem
Whiteboard!
Why gradient descent?
Gradient descent: learning rate = 0.05
Guess # | | |
0 | -3.000 | 160.128 |
1 | 0.493 | 9.672 |
2 | 1.308 | 1.478 |
3 | 1.498 | 1.032 |
4 | 1.542 | 1.007 |
Gradient descent: learning rate = 0.05
Guess # | | |
0 | -3.000 | 160.128 |
1 | 0.493 | 9.672 |
2 | 1.308 | 1.478 |
3 | 1.498 | 1.032 |
4 | 1.542 | 1.007 |
Gradient descent: learning rate = 0.05
Guess # | | |
0 | -3.000 | 160.128 |
1 | 0.493 | 9.672 |
2 | 1.308 | 1.478 |
3 | 1.498 | 1.032 |
4 | 1.542 | 1.007 |
Gradient descent: learning rate = 0.05
Guess # | | |
0 | -3.000 | 160.128 |
1 | 0.493 | 9.672 |
2 | 1.308 | 1.478 |
3 | 1.498 | 1.032 |
4 | 1.542 | 1.007 |
Gradient descent: learning rate = 0.05
Back to whiteboard…
Guess # | | |
0 | -3.000 | 160.128 |
1 | 0.493 | 9.672 |
2 | 1.308 | 1.478 |
3 | 1.498 | 1.032 |
4 | 1.542 | 1.007 |
Gradient descent: Putting it all together
Gradient descent: small learning rate
Gradient descent: large learning rate
Other forms of gradient descent
Stochastic GD
Mini-batch
Adam/Adagrad
Recap
Learning algorithms 🡪 Gradient descent and its sisters
New dataset
New dataset
A different hypothesis class
Polynomial with degree 1
Polynomial with degree 2
Polynomial with degree 3
Polynomial with degree 9
Polynomial with degree 15
Regularization
Equivalent to:
Revisiting the hypothesis class
Recall our previous function class definition
The regularized version
Different norms 🡪 Different hypothesis classes
The bias-variance tradeoff
Thought experiment:
Note: Every model will be slightly different…why?
The bias-variance tradeoff
The bias-variance tradeoff
The bias-variance tradeoff
The bias-variance tradeoff
The bias-variance tradeoff
Low bias, high variance
Large bias, low variance
Low bias, low variance
Holdout method
Observed data
K-fold cross validation, with K = 3
Observed data
Training data
Validation data
K-fold cross validation, with K=3
Observed data
Training data
Validation data
K-fold cross validation, with K=3
Observed data
Training data
Validation data
Training data
K-fold cross validation, with K=3
Round 1
�Round 2
�Round 3��
K-fold cross validation, with K=3
Round 1
�Round 2
�Round 3��Average
Recap
Hypothesis classes, regularization & bias-variance tradeoff
Learning representations
Recall the polynomial regression problem:
What if we do not know ?
Feature learning
pixel 1
pixel 2
pixel 1
pixel 2
Dogs
Non-Dogs
Input space
Example from J. Wiens
Feature learning
pixel 1
pixel 2
pixel 1
pixel 2
Dogs
Non-Dogs
Input space
“muzzle”
“paw”
muzzle
paw
Example from J. Wiens
Neural networks
Chalkboard!
Types of neural networks
Challenges in healthcare settings