How do the sign and magnitude of the SVM decision function determine classification?

Quick Overview

Asks how a support vector machine turns its decision function into a class label and what the size of the score means. Tests the link between the score, distance to the hyperplane and the margin, and why raw SVM scores need calibration before they can be used as probabilities.

How do the sign and magnitude of the SVM decision function determine classification?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

A trained support vector machine scores a new point $x$ with its decision function $f(x)$. How do the sign and magnitude of the SVM decision function determine classification? ```hint Recall the training constraints Recall the constraints a hard-margin SVM is trained with, and what geometric quantity the decision function becomes after you divide it by the norm of the weight vector. ``` ### What a Strong Answer Covers - How the sign maps to the predicted class, and what a value of zero means. - How the magnitude relates to the geometric distance from the hyperplane, and where the margin boundaries sit in terms of the score. - Why the raw score is not a probability, and how to turn it into one. - How the raw score is used in practice: threshold tuning, ranking metrics and multiclass prediction. ### Follow-up Questions - For an RBF-kernel SVM, how would you compute a point's distance to the decision boundary in feature space? - Why can `predict_proba` from a scikit-learn SVC disagree with `predict` for points near the boundary? - You need at least 95% recall on the positive class. How do you choose the threshold on the decision function, and on which data? - In one-vs-rest multiclass, why can comparing raw decision values across the binary classifiers mislead you?

Overview: Asks how a support vector machine turns its decision function into a class label and what the size of the score means. Tests the link between the score, distance to the hyperplane and the margin, and why raw SVM scores need calibration before they can be used as probabilities.

General logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

A trained support vector machine scores a new point xx with its decision function f(x)f(x).

How do the sign and magnitude of the SVM decision function determine classification?

What a Strong Answer Covers Guidance

  • How the sign maps to the predicted class, and what a value of zero means.
  • How the magnitude relates to the geometric distance from the hyperplane, and where the margin boundaries sit in terms of the score.
  • Why the raw score is not a probability, and how to turn it into one.
  • How the raw score is used in practice: threshold tuning, ranking metrics and multiclass prediction.

Follow-up Questions Guidance

  • For an RBF-kernel SVM, how would you compute a point's distance to the decision boundary in feature space?
  • Why can predict_proba from a scikit-learn SVC disagree with predict for points near the boundary?
  • You need at least 95% recall on the positive class. How do you choose the threshold on the decision function, and on which data?
  • In one-vs-rest multiclass, why can comparing raw decision values across the binary classifiers mislead you?