Docsity

Generalization error of SVM - Machine Learning, Lecture notes of Mathematics

Toggle sidebar
bg1
�
� �� �
�
Lecture 04 Generalization error of SVM. 18.465
Assume we have samples z1 = (x1,y1), . . . , zn = (xn, yn) as well as a new sample zn+1 . The classifier trained
on the data z1, . . . , zn is fz1,...,zn .
The error of this classifier is
Error(z1, . . . , zn) = Ezn+1 I(fz1,...,zn (xn+1) =�yn+1) = Pzn+1 (fz1,...,zn (xn+1) =�yn+1 )
and the Average Generalization Error
A.G.E. = E Error(z1, . . . , zn) = EEzn+1 I(fz1,...,zn (xn+1) =�yn+1).
Since z1, . . . , zn, zn+1 are i.i.d., in expectation training on z1, . . . , zi, . . . , zn and evaluating on zn+1 is the
same as training on z1, . . . , zn+1, . . . , zn and evaluating on zi. Hence, for any i,
A.G.E. = EEzi I(fz1,...,zn+1,...,zn (xi) =�yi)
and ⎤
n+1
⎡
⎢
⎢
⎢
⎢
⎣ ⎥
⎥
⎥
⎥
⎦
1
A.G.E. = E I(fz1,...,zn+1,...,zn (xi) =�yi) .
n + 1 i=1
leave-one-out error
Therefore, to obtain a bound on the generalization ability of an algorithm, it’s enough to obtain a bound
on its leave-one-out error. We now prove such a bound for SVMs. Recall that the solution of SVM is
n+1 α0
i yixi.ϕ = i=1
Theorem 4.1.
L.O.O.E. ≤ min(# support vect., D2/m2)
n + 1
where D is the diameter of a ball containing all xi, i ≤ n + 1 and m is the margin of an optimal hyperplane.
+
-
+
+
+
+
+
+
-
-
--
-
m
Remarks:
dependence on sample size is n
1
•
dependence on margin is m
1
• 2
• number of support vectors (sparse solution)
6
pf3

Partial preview of the text

Download Generalization error of SVM - Machine Learning and more Lecture notes Mathematics in PDF only on Docsity!

Assume we have samples z 1 = (x 1 , y 1 ),... , zn = (xn, yn) as well as a new sample zn+1. The classifier trained

on the data z 1 ,... , zn is fz 1 ,...,zn

The error of this classifier is

Error(z 1 ,... , zn) = Ez n+ I(fz 1 ,...,zn (xn+1) =� yn+1) = Pz n+ (fz 1 ,...,zn (xn+1) =� yn+1)

and the Average Generalization Error

A.G.E. = E Error(z 1 ,... , zn) = EEzn+1 I(fz 1 ,...,zn (xn+1) =� yn+1).

Since z 1 ,... , zn, zn+1 are i.i.d., in expectation training on z 1 ,... , zi,... , zn and evaluating on zn+1 is the

same as training on z 1 ,... , zn+1,... , zn and evaluating on zi. Hence, for any i,

A.G.E. = EEzi I(fz 1 ,...,zn+1,...,zn (xi) =� yi)

and ⎤

n+

A.G.E. = E I(fz 1 ,...,zn+1,...,zn (xi) =� yi). n + 1 i=

leave-one-out error

Therefore, to obtain a bound on the generalization ability of an algorithm, it’s enough to obtain a bound

on its leave-one-out error. We now prove such a bound for SVMs. Recall that the solution of SVM is

n+ α

0 ϕ = (^) i=1 i yixi.

Theorem 4.1.

L.O.O.E. ≤

min(# support vect., D

2 /m

2 )

n + 1

where D is the diameter of a ball containing all xi, i ≤ n + 1 and m is the margin of an optimal hyperplane.

m

Remarks:

dependence on sample size is n

1

dependence on margin is m

1

  • (^2)
  • number of support vectors (sparse solution)

Lemma 4.1. If xi is a support vector and it is misclassified by leaving it out, then α

0 i ≥^ D

1

Given Lemma 4.1, we prove Theorem 4.1 as follows.

Proof. Clearly,

support vect.

L.O.O.E. ≤ n + 1

Indeed, if xi is not a support vector, then removing it does not affect the solution. Using Lemma 4.1 above,

D

2

I(xi is misclassified) ≤ αi

0 D

2 = D

2 αi

0

m 2

i∈supp.vect i∈supp.vect

In the last step we use the fact that α

0

1 2.^ Indeed,^ since^ |ϕ|^ =^

1 i , m m

m

2

= |ϕ|

2 = ϕ · ϕ = ϕ ·

α

0 i yixi

= αi

0 (yiϕ ·xi)

= α

0 i (yi(ϕ xi + b) − 1) + α i

0 − b α

0 i · yi

� �� � � �� � 0 0

= α

0 i

We now prove Lemma 4.1. Let u ∗ v = K(u, v) be the dot product of u and v, and �u� = (K(u, u))

1 / 2 be

the corresponding L 2 norm. Given x 1 , , xn+1 ∈ R d · · · and y 1 , · · ·, yn+1 ∈ {− 1 , +1}, recall that the primal

problem of training a support vector classifier is argmin ψ (^2)

1 �ψ�

2 subject to yi(ψ ∗ xi + b) ≥ 1. Its dual

problem is argmaxα

αi − 2

1 �

αiyixi�

2 subject to αi ≥ 0 and

αiyi = 0, and ψ =

αiyixi. Since the

1 1 2 1 Kuhn-Tucker condition can be satisfied, minψ 2 ψ ∗ ψ = maxα αi − 2 � αiyixi� = 2 m^2 , where m is the

margin of an optimal hyperplane.

1 Proof. Define w(α) =

i αi −

αiyixi�

2

. Let α

0 = argmaxαw(α) subject to αi ≥ 0 and

αiyi = 0. Let 2

α

� = argmaxαw(α) subject to αp = 0, αi ≥ 0 for i �= p and αiyi = 0. In other words, α

0 corresponds to

the support vector classifier trained from {(xi, yi) : i = 1, , n+1} and α

� · · · corresponds to the support vector ⎛ ⎞ 1 p− 1 p p+1 n+

classifier trained from {(xi, yi) : i = 1, , p − 1 , p + 1, , n + 1}. Let γ = ⎝ 0

↓ , (^0)

↓ , (^1)

↓ , (^0)

↓ , (^0)

↓ · · · · · · · · · , · · · , ⎠. It

follows that w(α

0 − α

0 γ) ≤ w(α

� ) ≤ w(α

0 ). (For the dual problem, α

� p · maximizes^ w(α)^ with^ a^ constraint

that αp = 0, thus w(α

� ) is no less than w(α

0 − α

0 p ·γ),^ which^ is^ a^ special^ case^ that^ satisfies^ the^ constraints,

including αp = 0. α

0 maxmizes w(α) with a constraint αp ≥ 0, which raises the constraint αp = 0, thus

w(α

� ) ≤ w(α

0 ). For the primal problem, the training problem corresponding to α

� has less samples (xi, yi),

where i = p, to separate with maximum margin, thus its margin m(α

� ) is no less than the margin m(α

0 � ),