CSC 411: Lecture 09: Naive Bayes
Class based on Raquel Urtasun & Rich Zemel’s lectures Sanja Fidler
University of Toronto
Feb 8, 2015
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 1 / 28
CSC 411: Lecture 09: Naive Bayes Class based on Raquel Urtasun & - - PowerPoint PPT Presentation
CSC 411: Lecture 09: Naive Bayes Class based on Raquel Urtasun & Rich Zemels lectures Sanja Fidler University of Toronto Feb 8, 2015 Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 1 / 28 Today Classification
University of Toronto
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 1 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 2 / 28
◮ learn p(y|x) directly (logistic regression models) ◮ learn mappings from inputs to classes (least-squares, neural nets)
◮ Build a model of p(x|y) ◮ Apply Bayes Rule Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 3 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 4 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 5 / 28
k (x − µk)
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 6 / 28
1
2
d
1
2
d
1
2
d
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 7 / 28
1
2
d
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 8 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 9 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 10 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 11 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 12 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 13 / 28
k | − 1
k (x − µk) +
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 14 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 15 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 16 / 28
N
N
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 17 / 28
N
n=1 ✶[t(n) = 0] · x(n)
n=1 ✶[t(n) = 0]
n=1 ✶[t(n) = 1] · x(n)
n=1 ✶[t(n) = 1]
N
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 18 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 19 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 20 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 21 / 28
d
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 22 / 28
k
d
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 23 / 28
ik
n=1 ✶[t(n) = k] · x(n) i
n=1 ✶[t(n) = k]
ik
n=1 ✶[t(n) = k] · (x(n) i
n=1 ✶[t(n) = k]
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 24 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 25 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 26 / 28
k | − 1
k (x − µk) +
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 27 / 28
Urtasun, Zemel, Fidler (UofT) CSC 411: 09-Naive Bayes Feb 8, 2015 28 / 28