Back to the 2025 paper

Unit 3: Classification & Regression

20257m

Explain the concept of SVM for linear classification. Define margin, support vectors, and how the optimal hyperplane is determined.

Worked SolutionAI Assisted

SVM for Linear Classification:

Goal: Find hyperplane wTx+b=0w^T x + b =0 that maximally separates classes y∈{−1,1}y\in\{-1,1\}.

Margin: Distance from hyperplane to closest training point. For canonical hyperplane yi(wTxi+b)≥1y_i(w^T x_i+b)\ge1, geometric margin =1/∣∣w∣∣=1/||w||, total margin width =2/∣∣w∣∣=2/||w||. SVM maximizes this.

Support Vectors: Training points lying exactly on margin boundaries yi(wTxi+b)=1y_i(w^T x_i+b)=1. They are critical — removing non-support vectors doesn't change solution. Solution w=∑αiyixiw=\sum \alpha_i y_i x_i depends only on SVs where αi>0\alpha_i>0.

Optimal Hyperplane Determination:

Primal (hard margin):
min⁡w,b12∣∣w∣∣2\min_{w,b} \frac12||w||^2 s.t. yi(wTxi+b)≥1y_i(w^T x_i+b)\ge1

For non-separable, soft margin with slack ξi\xi_i:
min⁡w,b,ξ12∣∣w∣∣2+C∑ξi\min_{w,b,\xi} \frac12||w||^2 + C\sum \xi_i s.t. yi(wTxi+b)≥1−ξiy_i(w^T x_i+b)\ge1-\xi_i, ξi≥0\xi_i\ge0

CC trades margin vs errors.

Solving:
Lagrangian dual: max⁡α∑αi−12∑i,jαiαjyiyjxiTxj\max_\alpha \sum\alpha_i -\frac12\sum_{i,j}\alpha_i\alpha_j y_i y_j x_i^T x_j s.t. 0≤αi≤C0\le\alpha_i\le C, ∑αiyi=0\sum\alpha_i y_i=0. Quadratic programming. Then w=∑αiyixiw=\sum\alpha_i y_i x_i, bb from SV (average). Decision: f(x)=sign(wTx+b)f(x)=sign(w^T x + b).

Geometric intuition: Push two parallel supporting hyperplanes wTx+b=±1w^T x+b=\pm1 as far apart as possible without violating, supports touch boundaries. Largest margin gives best generalization (VC dimension). Kernel trick extends to non-linear by K(xi,xj)K(x_i,x_j).

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.