CAB212 · Unit 3: Classification
Support vector machines and kernels
8 practice questions
Key points
- Maximum-margin hyperplane; width = 2/||w||
- Support vectors define the boundary
- Large C -> narrow margin, less tolerance
- Kernels handle non-linear data
An SVM finds the hyperplane w.x + b = 0 that separates classes with the maximum margin. The margin width is 2 / ||w||, so maximising margin means minimising ||w||.
Worked example: w = (3, 4) has ||w|| = 5, so the margin width is 2/5 = 0.4.
Support vectors are the training points on the margin boundaries; only they determine the hyperplane.
- Hard margin: no violations allowed; needs linearly separable data.
- Soft margin: allows violations with penalty parameter C. Large C: fewer violations, narrower margin, risk of overfitting. Small C: wider margin, more tolerance.
- Kernel trick: compute inner products in a high-dimensional space without constructing it. Common kernels: linear, polynomial, RBF (Gaussian). RBF has parameter gamma: large gamma gives very local, wiggly boundaries.
Features should be scaled. SVMs work well on medium-sized, high-dimensional data and scale poorly to very large n.
Exam pitfall: moving or removing a non-support-vector point does not change the solution.
Try two questions
The kernel trick lets an SVM:
- Avoid using class labels during training
- Skip feature scaling entirely
- Fit non-linear boundaries by implicit mapping to a higher-dimensional space
- Train a model without any data
Show the answer
C. Kernels compute inner products in feature space cheaply.
The points that lie closest to an SVM decision boundary and define it are called:
- Centroids
- Principal components
- Outliers only
- Support vectors
Show the answer
D. They sit on the margin.