Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters...

36
KIT, Interactive Systems Laboratories 1 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton legen

Transcript of Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters...

Page 1: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories1 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Sie können Ihre Übungsblätter vorne in den

„Abgabe“-Kartonlegen

Page 2: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT – University of the State of Baden-Wuerttemberg andNational Research Center of the Helmholtz Association

KIT, Institute for Anthropomatics and Robotics, Department of Informatics, Interactive Systems Laboratories

www.kit.edu

Kognitive Systeme – Übung 222.06.2016 – Klassifikation und Spracherkennung

Matthias Sperber, Thai Son Nguyen

Page 3: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories3 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

Aufgabe 2: Fehlerwahrscheinlichkeit

Aufgabe 3: k Nearest Neighbours

Aufgabe 4: Perzeptronen

Aufgabe 5: Neuronale Netze

Page 4: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories4 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1b)

n: je mehr, desto besser

Erwartungswert:

Varianz:

Page 5: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories5 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1b)

n=10

Zufallszahlen: 5.951; 6.196; 6.409; 4.908; 4.876; 5.590; 6.102; 4.915; 4.818; 6.136;

Erwartungswert:

Page 6: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories6 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1b)

Varianz / Standardabweichung:

Page 7: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories7 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1b)

Geschätzte Verteilung: p(x|w1) ~ N(5.590; 0.645)

n variieren?

Page 8: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories8 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1c)

Naive Bayes Klassifikator:

Bayes:

„naive“ Annahme:

P(x) immer gleich:

Klassifizierungsregel:

Page 9: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories9 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1c)

Naive Bayes Klassifikator:

Bsp: Positive / negative movie review„unbelievably disappointing“

„Full of zany characters and richly applied satire, and some great plot twists“

„this is the greatest screwball comedy ever filmed“

„it was pathetic. The worst part about it was the boxing scenes“

Page 10: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories10 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1c)

Naive Bayes Klassifikator:

Bsp: Positive / negative movie review„unbelievably disappointing“

„Full of zany characters and richly applied satire, and some great plot twists“

„this is the greatest screwball comedy ever filmed“

„it was pathetic. The worst part about it was the boxing scenes“

Hohe WS für P(neg|“disappointing“), P(neg|“pathetic“)

Hohe WS für P(pos|“greatest“), P(pos|“good“)

Aber: „the movie was not good“

Page 11: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories11 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1c)

Gaussian Naive Bayes Klassifikator:Haben kontinuierliche Features → brauchen WS-Dichtefunktion für P(x|y)

Hier: P(x|y) ~ Gauß(mu,sigma)

→ Parametrisches Lernverfahren

Vorteil: sehr schnell, oft ausreichend gute Genauigkeit

Page 12: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories12 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1c)

Gegeben:

p(x|w1) ~ N(5.590; 0.645)

p(x|w2) ~ N(5.5; 1)

p(w1) = 0.3

p(w2) = 0.7

Gesucht:

P(w1|x), P(w2|x)

Mit Bayes Regel:

p(x): unbekannt, aber gleich für beide Klassen

Page 13: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories13 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1c)

Page 14: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories14 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

1c)

Page 15: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories15 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 2: Fehlerwahrscheinlichkeit

2a)

Gegeben:

Fehlerwahrscheinlichkeit:

Page 16: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories16 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

2a)

Page 17: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories17 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

2b)

Optimaler Schwellwert: dort, wo sich die Fehlerwahrscheinlichkeitsfunktionen kreuzen

Page 18: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories18 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

2b)

Page 19: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories19 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

2c)

Page 20: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories20 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

2c)

Page 21: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories21 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 1: Zufallsexperiment

2d)

Mögliche Fehlerquellen:WS-Dichtefunktionen auf zu wenig Daten geschätzt, ungenau

Daten sind in Wirklichkeit nicht Gauß-verteilt

Page 22: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories22 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 3: k Nearest Neighbours

Recap

Parametrisch?

Page 23: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories23 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 3: k Nearest Neighbours

Recap

Parametrisch?

Nein

„Lazy Learning“

Klassifizierung / Regression

K: wie wählen?

Zu klein → Outlier gewinnen Einfluss

Zu groß → Grenzen werden unscharf

Heuristik: sqrt(n)

Besser: Hyperparameter Tuning

Page 24: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories24 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 3: k Nearest Neighbours

a) Klassifizierung für k = 1 und k = 5

2 Klassen:

Kreuze

Quadrate

Neues Merkmal bei (6,4)

Page 25: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories25 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 3: k Nearest Neighbours

a) Klassifizierung für k = 1 und k = 5

k = 1:

(6,4) wird als Kreis klassifiziert

Page 26: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories26 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 3: k Nearest Neighbours

a) Klassifizierung für k = 1 und k = 5

k = 5:

(6,4) wird als Kreuz klassifiziert

Page 27: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories27 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 4: Perzeptronen

(I) nicht linear separierbar

Page 28: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories28 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 4: Perzeptronen

(II) lässt sich mit einfachem Perzeptron trennen

Page 29: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories29 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 4: Perzeptronen

(III) Klassen nicht linear separierber

Page 30: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories30 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 4: Perzeptronen

(IV) Klassen in Polarkoordinaten nicht linear separierber

Page 31: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories31 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 4: Perzeptronen

(V) Klassen nicht mit einzelnem Perzeptron trennbar

Page 32: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories32 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 4: Perzeptronen

(VI) Klassen sind mit MLP trennbar

Page 33: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories33 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 5: Neuronale Netze

Diskriminierungsfunktion:

Trenngerade bei g(x) = 0

Lernregel

Page 34: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories34 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 5: Neuronale Netze

Page 35: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories35 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 5: Neuronale Netze

Page 36: Sie können Ihre Übungsblätter vorne in den „Abgabe“-Karton ... · „Full of zany characters and richly applied satire, and some great plot twists“ „this is the greatest

KIT, Interactive Systems Laboratories36 22.06.16 Übung 2 – Maschinelles Lernen und Klassifikation

Aufgabe 5: Neuronale Netze