GATE DA 2025 · Support Vector Machine (SVM)

MSQ · 2 marks · Problem ML-SVM-0018

Consider designing a linear binary classifier \(f(x) = \text{sign}(w^T x + b), x \in \mathbb{R}^2\) on the following training data:Class-1: \[\left\{ \begin{pmatrix} 2 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 2 \end{pmatrix}, \begin{pmatrix} 2 \\ 2 \end{pmatrix} \right\}\], Class-2: \[\left\{ \begin{pmatrix} 0 \\ 0 \end{pmatrix} \right\}\]Hard-margin support vector machine (SVM) formulation is solved to obtain \(w\) and \(b\). Which of the following options is/are correct?
  1. A
    \[w = \begin{pmatrix} 4 \\ 4 \end{pmatrix}\] and \(b = 1\)
  2. B
    The number of support vectors is 3
  3. C
    The margin is \(\sqrt{2}\)
  4. D
    Training accuracy is 98\%

Solve it on GATE DA practice →More Supervised Learning — Classification problems

Show the worked solutionClass-1 \(=\{(2,0),(0,2),(2,2)\}\), Class-2 \(=\{(0,0)\}\). By symmetry, the optimal separating hyperplane is perpendicular to the direction \((1,1)\) (connecting the origin to the midpoint of \((2,0)\) and \((0,2)\)).Solving the hard-margin SVM conditions with \(w=(k,k)\), we find \(w=(1,1)\), \(b=-1\) satisfies: \(f(0,0)=-1\) (margin value \(=1\) in magnitude), \(f(2,0)=f(0,2)=1\) (also margin \(=1\)), and \(f(2,2)=3\) (well inside the safe region, not a support vector).So the support vectors are exactly \((0,0),(2,0),(0,2)\) — \(3\) support vectors.Margin (full width between the two margin boundaries) \(=\dfrac2{\|w\|}=\dfrac2{\sqrt{1^2+1^2}}=\dfrac2{\sqrt2}=\sqrt2\)(The candidate \(w=(4,4),b=1\) doesn't actually satisfy the margin constraints correctly for this data, so that option is incorrect; training accuracy is \(100\%\) for a hard-margin solution on separable data, not \(98\%\).)Answer: B, C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com