The four XOR points and with label , and and with label , are not linearly separable. Solving the hard-margin SVM dual with the kernel , what are the , the bias and the decision function?
Supervised learning, Kernel SVM numericals
Level L3 Intermediate. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can build a kernel matrix, exploit symmetry to solve a small dual, and interpret the resulting decision function.
Key idea
Maximise with , subject to and . By symmetry all four are equal.
Steps
- Kernel matrix: . For and , , so . For points from different pairs, , so . Hence .
- With : . The constraint kills the second term, leaving .
- By symmetry, set all . The constraint holds (). The objective is .
- Differentiate: , so . Dual value , so in feature space.
- All four points are support vectors. Find from : the sum is , so .
- Decision function: expand and sum with weights . The terms , , , , cancel, and only the cross term survives. This gives .
- So the classifier is the sign of , which separates XOR perfectly. The separating hyperplane lives in the feature space, where is a coordinate.
Common mistakes
- Assuming the dual is solved by or by setting all the to the same value without checking .
- Treating the kernel matrix entries as without squaring.
- Forgetting to check that makes the margin conditions hold for all four points.
How long your answer should be
One page; 7–8 minutes.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: In a screening task, a false negative costs 20 and a false positive costs 1, with no cost for correct decisions. What probability threshold minimises expected cost? A model trained after keeping only 10% of the negatives outputs for a patient. What is the true probability, and what do we decide?
Next in Supervised learning: A soft-margin SVM uses a different penalty for each class: with the usual constraints. What changes in the dual and in the KKT conditions? In what direction does the boundary move if , and how would you choose for an imbalanced dataset?