Was kommt jetzt?
! " #
$ % " & ' "
( ! & )
* ( + & )
Entscheidungsbaum
&
, ,
!
, , ,
- " - "
- "
≤ ./0 1 ./0 ≤ 2/0 12/0
3 3
≤ 2/0 14 3
* + ( )
+ (3)
5
Entscheidungsbäume
" %
#
6 % # " + 6 /
% " " 3 $ /
" 6 + # %
%
# # " + /
#
Beispiel
&
, ,
!
, , ,
- " - "
- "
≤ ./0 1 ./0 ≤ 2/0 12/0
3 3
≤ 2/0 14 3
# 7
87& ,
! ,
- " , 2
Lernen von
Entscheidungsbäumen
9 7
7# & " % 6 /
+ ! 6 #
: 76 6 "
! "
; 7
" / # " " " " &
Beispiele
& ! - "
8 2
< = 3
. 2
> 0 3
0 = 3
? ?
2 88 3
= 4 3
4 4
& ! - "
8@ =
88 2 3
8< 8@
8. ?
8> 2 3
80 . 3
8? >
Beispiele nach Attributen sortiert
& 7
8 . 0 3
? 2 3
= 3 4 8@
8.
80 3 8?
72 / 37>
- 788
& 7
< 3
> 3 88 3 8<
8> 3
78/ 37>
- 70
! 7
8 88 3 8.
80 3 8?
7./37<
- 70
! 7
> 3 4 8@
8> 3 7</ 37<
- 7>
! 7
< 3 . 0 3
? 2 3
= 3 8<
7./37>
- 72
- " 7 1?/0 8
< 3 . 0 3 8@
88 3 8<
8> 3
7> / 37>
- 7=
- " 7
≤?/0
> 3
? 8.
80 3 8?
7./ 37<
- 70
Rekursiver Ansatz
/ " ! " 6 + % " " /
+ % / + 6 + " # % " "
+ 6 " " & #
+ !
- &
, ,
3
>A88 & 8A0 &
+ + 6 / +
& #
- & ,
B8/./0/?/2/=/4/8@/8./80/8?C
- & ,
B</>/88/8</8>C
Beispiel
&
, ,
B8/./0/?/2/=/4/8@/8./80/8?C B</>/88/8</8>C
!
, , ,
- " - "
≤ ./0 1 ./0 ≤ 2/0 12/0
3 3
B8/8./80/8?C B./0/?/2/=C B4/8@C
B80C B8/8./8?C B./?C B0/2/=C
- "
≤ 4 14 3
B</>/88/8>C B8<C
@ & #
TDIDT - Algorithmus
- - ( / - )
& # ! /
# " $
&$ D - - / E ! (- / )
! - " F E ! $
- - " !G 6 +
8/ /
&$ , 8/ / % 7 - - ( / - HB- C)
"
- ! " $
Qualitätsmaß
" 7 + % D IA I& " / "
" J #
K pi " +
" &
" " m " ( )7
+ % & " / " D
"
i m
i
i
p
p log
=1
−
Informationsgewinn
: "
6 6 ! " +
: ! #
+ - + ! / "
# " " "
Beispiel
&
B</>/88/8</8>C
- 7 ! ,
, , ,
B88C B</ 8<C B>/8>C
= +
− 5
log1 5 1 5 log 4 5 4
= +
+
− 1log1
2 log 1 2 1 1 log 1
- 7- "
≤ 4 14 3
B</>/88/8>C B8<C
0 1 log 1 1 log
1 + =
9 + - " FG
!
+ - " 6
- " + !
Probleme
L ( % )7 -
" " + / "
# / -
6 + 7 - - " -
% ! ( % )
# " M " N
- F %
# "
Was wissen Sie jetzt?
- - % 6 "
6 + / + /
- # " $
- " E ! " + !
+ ( " " )
" " + " + ! +
O> 0 ( + K > = ) " ! % +
%
Erinnerung: Funktionslernen
Gegeben:
Beispiele X in LE
– die anhand einer Wahrscheinlichkeitsverteilung P auf X erzeugt wurden und – mit einem Funktionswert Y = t(X) versehen sind (alternativ: Eine
Wahrscheinlichkeitsverteilung P(Y|X) der möglichen Funktionswerte - verrauschte Daten).
H die Menge von Funktionen in LH.
Ziel: Eine Hypothese h(X) ∈ H, die das erwartete Fehlerrisiko R(h) minimiert.
Risiko:
=
x
x P h x Q h
R ( ) ( , ) ( )
Beispiel: Funktionenlernen
• H = { f
a| f
a(x) = 1, für x ≥ a, f
a(x) = -1 sonst, a ∈ℜ }
• R(f
0) = 0,25 + 0 + 0,20 = 0,45
• R(f
1,5) = 0 + 0 + 0,20 = 0,20
• R(f
3,5) = 0 + 0,5 + 0,05 = 0,55
1 2 3
50%
0%
0%
25%
5%
20%
*$ 5
Reale Beispiele
7E ('/ ) , @/ (') , (')/ 8
- ' (' , ! )
: (' , ' # )
N P - + (' ,
& Q )
%" 6 " (' ,
N )
* 7E ('/ ) , ( (')I (')))
<; (' , ; / (') ,
! )
Erinnerung: Minimierung des beobachteten Fehlers
& F " 7
! & (R )
6 7
G " " $
& " "
" * "
Beispiel
Beispiel II
Probleme der ERM
6 7
& " " " " & ' + ! J
M % 7 N + #
$
Die optimale Hyperebene
# G / +
: P : / %
% # %
: G " : P / +
6 " ! % "
! % # " ' "
7 ' " "
" : P
H
d
d
Berechnung der opt. Hyperebene
: P
: , B' S + T'U , @C
: (' /P )/ P ∈B±8C
: " : P
(') , + T'U
(' ) 1 @ ⇔ P 1 @ SS+ SS " "
(' ) ≥ 8/ + P , 8
(' ) ≤ I8/ + P , I8
+1
-1
H f
Optimierungsaufgabe der SVM
" SS+ SS
<$ 7
(' ) , + T' U ≥ 8 $ P , 8 (' ) , + T' U ≤ I8 $ P , I8
V Q % 3 7P T (' ) ≥ 8
% ' / Q M " I "
M (
.) F
7SS+ SS , 8A / , 6 "
: P #
Nicht linear trennbare Daten
'
8 6 7
" " %
/ +
(" " & )
" 7 6 " + '
?
Weich trennende Hyperebene
• Wähle C ∈ℜ
>0und minimiere
• so dass für alle i gilt:
f(x
i) = w*x
i+b ≥ 1- ξ
ifür y
i= 1 und f(x
i) = w*x
i+b ≤ -1+ ξ
ifür y
i= -1
• Äquivalent: y
i*f(x
i) ≥ 1- ξ
i=
+
ni
C
iw
1
2
ξ
+1 f
ξ ξ
Duales Optimierungsproblem
• Umformung mit Lagrange-Multiplikatoren liefert einfacheres Optimierungsproblem:
• Maximiere
• unter 0 ≤ α
i≤ C für alle i und α
iy
i= 0
• Es gilt w = α
iy
ix
i, also f(x) = α
iy
i(x
i*x)+b
( )
= =
=
∗
−
=
ni
n
j
j i
j i j i n
i
i
y y x x
W
1 1
2 1 1
)
( α α α α
Bedeutung von ξξξξ und αααα
f(x)=0 f(x)=1 f(x)=-1
ξ =0, α =0
ξ >1, α =C 0< ξ <1, 0< α <C ξ =0, 0 ≤α <C
Beispiele x
imit α
i>0 heißen Stützvektoren SVM
Optimierungsalgorithmus
s = Gradient von W( α ) // s
i= α
j(x
j*x
i) while(nicht konvergiert(s)) // auf ε genau
WS = working_set(s) // suche k „gute“ Variablen α ‘ = optimiere(WS) // k neue α -Werte
s = update(s, α ‘) // s = Gradient von W( α ‘)
• Gradientensuchverfahren
• Trick: Stützvektoren allein definieren Lösung
• Weitere Tricks: Shrinking, Caching von x
i*x
jWas wissen wir jetzt?
& "
" " * F
M " : P ! *
' 7 + : P
# " N " "
9 "
: P J 3 J
Beispiel: Textklassifikation
To: rueping@ls8.cs.uni- dortmund.de
Subject: Astonishing
Guaranteed XXX Pictures FREE! Gao
In the next 2 minutes you are going to learn how to get access to totally FREE xxx pictures. Let me show you the secrets I have learned to get FREE porn passwords.
Indeed, with this in mind lets take a quick look below to see what you get, ok?
1 astonishing 3 free
2 in
2 pictures 1 porn 0 SVM 5 to
0 university 2 XXX
0.1 0.4 0.0 0.2 1.1 -0.6 0.0 -0.4 0.9
SVM
*
> 0TCat-Modell
- P " 78@ @@@ 8@@ @@@
N N + % F 5
' I I 7
positive Dokumente
negative Dokumente
Beispiel: Intensivmedizin
N %
% 6 "
J
: 9
N ! J
−
=
=
=
=
=
=
=
=
−
−
−
−
= 4 . 368
00 . 15
00 . 13
00 . 26
00 . 79
00 . 8
00 . 121
00 . 86
00 . 174
177 .
0 134 .
0
026 .
0
016 .
0
015 .
0
001 .
0 019 .
0
014 .
0
) (
papmn papdia papsys
hr cvp artmn artdia artsys
x
f
Bias-Varianz-Problem
; : P " 7
;
' " (# )
; G : P " 7
; % G !
6 + (N )
F 7 "
& 7
*( ) ≤
η*
"( ) U N ( )
Strukturelle Risikominimierung
8 M : P
- " " !G
" ' !
< ! D - I
" : P "
"
" &
. ! "
: P " " "
*
Komplexität Schranke(h) =
Remp(h) + Var(h)
Vapnik-Chervonenkis-Dimension
7 : %
: P "
% # / +
D - " %
∈: +
7 N OI "
% : P
: " ' " 6 %
# / % :
" +
VC-Dimension von Hyperebenen
7 N O I " : P
" * U8
# + 7
N O " (* ) ≥ U87 ! '@ , @ ' ,
(@/ /@/8/@/ @) &$
- " 6 % ('@/ /' ) P , 8/
' ∈ 6 P , 8
+ , P '
, P@A< + '@U , P@A<
+ ' U , P UP@A< 6 7+ 'U 6
N O " (* ) ≤ U87; $ $
& !
VC-Dim. und Anzahl der Parameter
• Setze f
α(x) = cos( α x) und x
i= 10
-i, i=1...l. Wähle y
i∈ {-1,1}. Dann gilt für α = π (
1/
2(1-y
i)10
i):
−
=
−
=
=
−
−
=
l
i
k i i
k l
i
i i
k
y y
x
1 2 1 1
2
1
( 1 ) 10 10 π ( 1 ) 10
π α
− +
− +
−
=
+
=
− −
=
− l
k i
k i i
k k
i
k i
i
y y
y
1 2 1 2
1 1
1 2
1
( 1 ) 10 ( 1 ) ( 1 ) 10
π
Vielfaches von 2 0 ≤ … ≤ 10
-1+10
-2+ … =1/9
(geometrische Reihe)
VC-Dim. und Anzahl der Parameter
(α' ), (π ) " ∈W@/8A4X $ P ,8 ∈W8/8@A4X $ P ,I 8
(α') " '8/ '
(α') N O I "
N O I " ! % 6
" 5
π 2 π 3 π
1
/
9cos
VC-Dimension der SVM
9 # '
8/ /' ∈ℜ "
SS' SS Y $ &$ N OI "
N + "
: P 7
N O " ( ) ≤ " B
<SS+ SS
</ CU8
" ' ! N
" ! (&
" )/
F 5
Wozu die ganze Theorie?
Erwartetes Risiko R(h)
Empirisches Risiko R
emp(h)
h fest n → ∞
SRM
h : R
srm(h) = min
h‘R
srm(h‘)
Optimale Hypothese h : R(h) = min
h‘R(h‘) n → ∞
Optimale Hypothese h : R(h) = min
h‘R(h‘) ERM
h : R
emp(h) = min
h‘R
emp(h‘) n → ∞
F $ " J * 5
Was wissen wir jetzt?
* " " 7
$ *
+ " ' !
& " " ' ! 7N OI "
* N
9 $
M & 73$ $ ' J
Performanzschätzer
+ * *( ) N J
*( )
- ( " M % )
M " N OI " ( )
% A % IM IM I !
( )
Performanzschätzer II
7 % IM IM I& N
! *
8≤ S N S A
# + 7& # +
$ % 6 73 I $ % +
3 I
$ % ! : P /
+ " 8 I-
Performanzschätzer III
7 % IM IM I& N
! *
8≤ SB 7(<α
<Uξ )≥8CS A
( , * Z " " # )
# + 7# &! 7
ξ =0, α =0
ξ >1, α =C 0< ξ <1, 0< α <C
Nicht-lineare Daten
Nicht-lineare Daten
J
3 N I- + J (3 5)
N J ([ P \%
" " / % P " ])
- " " 5
x
1x
2(x
1)
2x
2Φ(x1,x2) = (x12,x2)
Kernfunktionen
7
(') , α P (' T')U
N ! % ' $ 'T'\
- " Φ T
('
8/'
<) , Φ('
8)TΦ('
<)
( )
= =
=
∗
−
=
ni
n
j
j i
j i j i n
i
i
y y x x
W
1 1
2 1 1
)
( α α α α
X Z ℜ
K
Φ *
Kernfunktionen II
6 % Φ F / # 7
" ' ( (' /'
D))
/D,8" %
* I# 7 ('/P) , ' (IγSS'IPSS
<)
P " 7 ('/P) , ('TP)
3 3 7 ('/P) , ( ⋅'TPU )
% " "
% / "
% ; / % 6
Polynom-Kernfunktionen
• K
d(x,y) = (x*y)
d• Beispiel: d=2, x,y ∈ℜ
2. K
2(x,y) = (x*y)
2= ((x
1,x
2)*(y
1,y
2))
2= (x
1y
1+x
2y
2)
2= x
12y
12+2x
1y
1x
2y
2+x
22y
22= (x
12, √ 2x
1x
2,x
22)*(y
12, √ 2y
1y
2,y
22)
=: Φ (x)* Φ (y)
RBF-Kernfunktion
x
0x
exp(-1 ⋅ |x-x
0|
2) x x
0exp(-10 ⋅ |x-x
0|
2)
SVMs für Regression
"
$ 7
(' ) , + T' U ≤ P Uε UξT (' ) , + T' U ≥ P I ε I ξ
+ +
=
=
n
i
i n
i
C
iw
1
* 1
2
ξ ξ
f(x)
ξ
i* f(x)- ε
f(x)+ ε
Verlustfunktion
Q
f(x)-y - ε + ε
N Q N
Q
f(x)-y
Duales Optimierungsproblem
' "
@ ≤ α /α T ≤ O $ α T , α
P ∈BI8/U8C/ ε,@ α ,@ $ P ,8 α T,@ $ P ,I8 / ! "
I N 5
=
=
=
−
−
− +
−
−
=
nj i
j i j
j i
i n
i
i i
n
i
i i
i
K x x
y W
1 ,
*
* 2
1 1
* 1
*
) ( ) ( )( ) ( , )
( )
( α α α ε α α α α α α
Beispiel: Prognose von Zeitreihen
80 100 120 140 160 180 200 220
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100
Fenster Horizont
Prognose von Zeitreihen
-
; P
# ( / / )
% % # J
6 G
SVMs und Datenbanken
G " (" 9 # )
" M
"
. 6 ! 7
"
N
Inkrementelle SVMs
" ' Q
7 + - "
SVs 1 Dat.
1
SVM 1
SVs 2 Dat.
2
SVM 2
SVs 3 Dat.
3
SVM 3
SVs 4 Dat.
4
SVM 4
Ergebnis
SVMs in Datenbanken
; $
O ; " '
# E I6
# 79 !
6
Optimierung Daten
bank Cache
Working-Set Iteration
Kernfunktion in SQL
• SELECT
x1.att_1 * x2.att_1 + … + x1.att_d * x2.att_d FROM examples_table x1, examples_table x2
WHERE x1.index = i and x2.index = j
• SELECT <kernel term>
FROM examples_table x1, examples_table x2 WHERE x1.index = I
• SELECT <kernel term>
FROM examples_table x1, examples_table x2, free_examples f
WHERE x1.index = i AND x2.index = f.index
• Weitere Optimierung durch Ausnutzen der relationalen Struktur im Cache möglich.
Was man über SVMs wissen muss
& * *
M " : P 7 / # /
+ -
3 I !
* / N O I "
! "
* I N