Compute the separating line given by the linear SVM solution in the form $_2=⋅_1+$ :

130 Views Asked by At

Consider the following binary classification problem in ℝ2:

The points ($_1, _2$) labeled with +1 are: {(1,2),(0,2),(0,1),(1,1)}

The points ($_1, _2$) labeled with -1 are: {(5,3),(8,3),(8,6),(6,4)}

Compute the separating line given by the linear SVM solution in the form $_2=⋅_1+$:

What I have done so far:

  1. Plotted 2 hulls in the 2D space
  2. Found the line which is the closest distance between $2$ hulls. Line between points $(1,1)$ and $(5,3)$. Distance is equal to $4$.
  3. I found a mid-point of this line: $(3;2.5)$.

As far as I understood $d$ in the equation is exactly what I have found in (2) and is equal to $4$. What I need to do is to construct normal to the mid-point and this normal should be my $k$? Is it correct approach?

1

There are 1 best solutions below

2
On BEST ANSWER

Here is a Pictorial View :
SVM

You have Correctly found the 2 Points , then the MidPoint. Till here it is okay.

The MidPoint is not $d$. We can calculate "Slope" $k$ of the SVM by $-(5-1)/(3-2)=-4$
Then we have to substitute MidPoint in the line to calculate $d$.

[[
Elaborating the "Slope" Calculation , in reply to a comment :
When line1 with Slope $m_1$ is Parallel to line2 with Slope $m_2$ , we will have $m_2=m_1$.
When line1 is Perpendicular to line2 (Pair of Orthogonal lines) , then we will have $m_2=-1/m_1$ , which is a Standard theorem.
Here , the Slope of the line between the 2 Support Points is $(3-2)/(5-1)$ , hence , the Slope of the Perpendicular will have to be $-(5-1)/(3-2)$
]]

Let me know if you can continue. Otherwise I will update this Answer.

Continuing . . . . :

$x_1 = k \cdot x_2+d$
$3 = -4 \cdot 2.5+d$
$3 = -10+d$
$d = 13$

$x_1 = -4 \cdot x_2+13$