0
votes

I was reading the following sample problem on http://nlp.stanford.edu/ enter image description here

"Consider building an SVM over the (very little) data set shown in Figure. Working geometrically, for an example like this, the maximum margin weight vector will be parallel to the shortest line connecting points of the two classes, that is, the line between (1,1) and (2,3), giving a weight vector of (1,2). The optimal decision surface is orthogonal to that line and intersects it at the halfway point. Therefore, it passes through (1.5,2). So, the SVM decision boundary is:

y = x_1 + 2x_2 - 5.5"

Can anybody kindly explain to me how we have got this equation? Thanks a lot in advance.

2
This question appears to be off-topic because it is about geometry.Fred Foo

2 Answers

1
votes

The line is perpendicular to the line between (1,1) and (2,3), and pass their center ((1+2)/2,(1+3)/2). Thus such line will achieve the maximum margin and separate (1,1) and (2,3).

0
votes

A(1,1), B(2,3)

𝑤 ⃗=(2,3)−(1,1)=(𝑎,2𝑎)

g(1,1) = -1; A : a + 2a + 𝑤0=−1 …①

g(2,3) = 1; B : 2a + 6a + 𝑤0=1 …②

② ; 𝑤0=1-8a

② substituted to ① ; 3a + 1 -8a = -1

a=2/5, 𝑤0=−11/5

𝑤 ⃗=(2/5,4/5) …>support vector

𝑔(𝑥 ⃗ )=(2/5,4/5)(𝑥_1,𝑥_2 )+(−11/5) 𝑔(𝑥 ⃗ )=𝑥_1+2𝑥_2−5.5

I hope it helps.