generative and discriminative learning - · pdf filemachine learning fall 2017 generative and...

20
Machine Learning Fall 2017 Generative and Discriminative Learning 1

Upload: dangkhanh

Post on 07-Feb-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

MachineLearningFall2017

GenerativeandDiscriminativeLearning

1

Page 2: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Whatwesawmostofthesemester

• Afixed,unknowndistributionDoverX£ Y– X:Instancespace,Y:labelspace(eg:{+1,-1})

• GivenadatasetS={(xi,yi)}

• Learning– IdentifyahypothesisspaceH,definealossfunctionL(h,x,y)– Minimizeaveragelossovertrainingdata(plusregularization)

• Theguarantee– Ifwefindanalgorithmthatminimizeslossontheobserveddata– Then,learningtheoryguaranteesgoodfuturebehavior(asafunction

ofH)

2

Page 3: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Whatwesawmostofthesemester

• Afixed,unknowndistributionDoverX£ Y– X:Instancespace,Y:labelspace(eg:{+1,-1})

• GivenadatasetS={(xi,yi)}

• Learning– IdentifyahypothesisspaceH,definealossfunctionL(h,x,y)– Minimizeaveragelossovertrainingdata(plusregularization)

• Theguarantee– Ifwefindanalgorithmthatminimizeslossontheobserveddata– Then,learningtheoryguaranteesgoodfuturebehavior(asafunction

ofH)

3

IsthisdifferentfromassumingadistributionoverXandafixedoraclefunctionf?

Page 4: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Whatwesawmostofthesemester

• Afixed,unknowndistributionDoverX£ Y– X:Instancespace,Y:labelspace(eg:{+1,-1})

• GivenadatasetS={(xi,yi)}

• Learning– IdentifyahypothesisspaceH,definealossfunctionL(h,x,y)– Minimizeaveragelossovertrainingdata(plusregularization)

• Theguarantee– Ifwefindanalgorithmthatminimizeslossontheobserveddata– Then,learningtheoryguaranteesgoodfuturebehavior(asafunction

ofH)

4

IsthisdifferentfromassumingadistributionoverXandafixedoraclefunctionf?

Page 5: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Whatwesawmostofthesemester

• Afixed,unknowndistributionDoverX£ Y– X:Instancespace,Y:labelspace(eg:{+1,-1})

• GivenadatasetS={(xi,yi)}

• Learning– IdentifyahypothesisspaceH,definealossfunctionL(h,x,y)– Minimizeaveragelossovertrainingdata(plusregularization)

• Theguarantee– Ifwefindanalgorithmthatminimizeslossontheobserveddata– Then,learningtheoryguaranteesgoodfuturebehavior(asafunction

ofH)

5

IsthisdifferentfromassumingadistributionoverXandafixedoraclefunctionf?

Page 6: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Whatwesawmostofthesemester

• Afixed,unknowndistributionDoverX£ Y– X:Instancespace,Y:labelspace(eg:{+1,-1})

• GivenadatasetS={(xi,yi)}

• Learning– IdentifyahypothesisspaceH,definealossfunctionL(h,x,y)– Minimizeaveragelossovertrainingdata(plusregularization)

• Theguarantee– Ifwefindanalgorithmthatminimizeslossontheobserveddata– Then,learningtheoryguaranteesgoodfuturebehavior(asafunction

ofH)

6

IsthisdifferentfromassumingadistributionoverXandafixedoraclefunctionf?

Page 7: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Discriminativemodels

Goal:learndirectlyhowtomakepredictions

• Lookatmany(positive/negative)examples

• Discoverregularitiesinthedata

• Usethesetoconstructapredictionpolicy

• Assumptionscomeintheformofthehypothesisclass

Bottomline:approximatingh:X→YisestimatingP(Y|X)

7

Page 8: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Generativemodels

• Explicitlymodelhowinstancesineachcategoryaregenerated

• Thatis,learnP(X|Y) andP(Y)

• WedidthisfornaïveBayes– NaïveBayesisagenerativemodel

• PredictP(Y|X)usingtheBayesrule

8

Page 9: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Example:GenerativestoryofnaïveBayes

9

Page 10: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Example:GenerativestoryofnaïveBayes

10

YP(Y)

Firstsamplealabel

Page 11: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Example:GenerativestoryofnaïveBayes

11

YP(Y)

X1

P(X1 |Y)

Giventhelabel,samplethefeaturesindependentlyfromtheconditionaldistributions

Page 12: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Example:GenerativestoryofnaïveBayes

12

YP(Y)

X1

P(X1 |Y)

X2

P(X2 |Y)

Giventhelabel,samplethefeaturesindependentlyfromtheconditionaldistributions

Page 13: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Example:GenerativestoryofnaïveBayes

13

YP(Y)

X1

P(X1 |Y)

X2

P(X2 |Y)

X3

P(X3 |Y)

Giventhelabel,samplethefeaturesindependentlyfromtheconditionaldistributions

Page 14: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Example:GenerativestoryofnaïveBayes

14

YP(Y)

X1

P(X1 |Y)

X2

P(X2 |Y)

X3

P(X3 |Y)

...

Giventhelabel,samplethefeaturesindependentlyfromtheconditionaldistributions

Page 15: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

Example:GenerativestoryofnaïveBayes

15

YP(Y)

X1

P(X1 |Y)

X2

P(X2 |Y)

X3

P(X3 |Y)

Xd

P(Xd |Y)

...

Giventhelabel,samplethefeaturesindependentlyfromtheconditionaldistributions

Page 16: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

• Generativemodels– learnP(x,y)– Characterizehowthedataisgenerated(bothinputsandoutputs)– Eg:NaïveBayes,HiddenMarkovModel

• Discriminativemodels– learnP(y|x)– Directlycharacterizesthedecisionboundaryonly– Eg:LogisticRegression,Conditionalmodels(severalnames)

Generativevs Discriminativemodels

16

Page 17: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

• Generativemodels– learnP(x,y)– Characterizehowthedataisgenerated(bothinputsandoutputs)– Eg:NaïveBayes,HiddenMarkovModel

• Discriminativemodels– learnP(y|x)– Directlycharacterizesthedecisionboundaryonly– Eg:LogisticRegression,Conditionalmodels(severalnames)

Generativevs Discriminativemodels

17

Page 18: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

• Generativemodels– learnP(x,y)– Characterizehowthedataisgenerated(bothinputsandoutputs)– Eg:NaïveBayes,HiddenMarkovModel

• Discriminativemodels– learnP(y|x)– Directlycharacterizesthedecisionboundaryonly– Eg:LogisticRegression,Conditionalmodels(severalnames)

Generativevs Discriminativemodels

18

Page 19: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

• Generativemodels– learnP(x,y)– Characterizehowthedataisgenerated(bothinputsandoutputs)– Eg:NaïveBayes,HiddenMarkovModel

• Discriminativemodels– learnP(y|x)– Directlycharacterizesthedecisionboundaryonly– Eg:LogisticRegression,Conditionalmodels(severalnames)

Generativevs Discriminativemodels

19

Page 20: Generative and Discriminative Learning - · PDF fileMachine Learning Fall 2017 Generative and Discriminative Learning 1. What we saw most of the semester • A fixed, unknown distribution

• Generativemodels– learnP(x,y)– Characterizehowthedataisgenerated(bothinputsandoutputs)– Eg:NaïveBayes,HiddenMarkovModel

• Discriminativemodels– learnP(y|x)– Directlycharacterizesthedecisionboundaryonly– Eg:LogisticRegression,Conditionalmodels(severalnames)

Generativevs Discriminativemodels

Agenerativemodeltriestocharacterizethedistributionoftheinputs,adiscriminativemodeldoesn’tcare

20