yoklainterview sim

ML Engineer Cml Svm Kernels Margins Interview Questions

75 verified ML Engineer Cml Svm Kernels Margins interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

Cml Svm Kernels MarginsDifficulty 1
A hard-margin linear SVM is trained on two perfectly separable classes. Among the infinitely many hyperplanes that separate them, which quantity does the SVM training objective make as large as possible?
  • aThe average distance from every training point to the hyperplane, over the whole sample.
  • bThe count of training points that receive a positive decision score.
  • cThe width of the empty band between the classes, which equals 2/||w||.
  • dThe distance between the two class centroids after projecting them onto the direction w.
Explanation:The separating hyperplane is w·x + b = 0, and the two margin boundaries are fixed at w·x + b = +1 and -1. The perpendicular distance between those two planes is 2/||w||, so maximizing the margin is the same as minimizing ||w||^2 subject to every point sitting on the correct side of its margin boundary. Averages over all points or centroid distances play no role in the objective.
Cml Svm Kernels MarginsDifficulty 2
A fitted two-dimensional linear SVM reports coef_ = [[3.0, 4.0]] and intercept_ = [-10.0]. How wide is the margin, that is the perpendicular distance between the two margin boundaries?
  • a0.4, because ||w|| is 5 and the width is 2/||w||.
  • b5.0, because the margin width is the norm of the weight vector.
  • c2.0, because the boundaries sit at decision values +1 and -1.
  • d0.2, because the margin width is one over the norm of w.
Explanation:The norm of (3, 4) is sqrt(9 + 16) = 5. The two margin boundaries are the level sets where the decision function equals +1 and -1, and moving between two such level sets covers a perpendicular distance of 2/||w|| = 2/5 = 0.4. The intercept only shifts the whole band, it does not change its width. Half of that distance, 1/||w|| = 0.2, is the gap from the boundary to one margin only.
Cml Svm Kernels MarginsDifficulty 2
For a point x with label y in {-1, +1}, the functional margin is y(w·x + b) and the geometric margin is the actual perpendicular distance to the hyperplane. Why does the SVM formulation fix the functional margin of the closest points to exactly 1?
  • aBecause a functional margin of exactly 1 is what guarantees correct classification of the point.
  • bBecause libsvm cannot represent decision values outside the range -1 to +1.
  • cBecause the geometric margin is undefined until a functional margin is chosen.
  • dBecause scaling w and b by the same factor rescales the functional margin without moving the plane.
Explanation:The hyperplane defined by (w, b) is identical to the one defined by (2w, 2b), yet the functional margin doubles. That makes the functional margin a meaningless target on its own. Dividing by ||w|| removes the ambiguity and gives the geometric margin; fixing the closest points at a functional margin of 1 is just a normalization that turns margin maximization into minimizing ||w||.
Cml Svm Kernels MarginsDifficulty 1
A colleague removes 40 training rows that sit far away from the decision boundary of a fitted linear SVC and refits with the same settings. The boundary comes back essentially unchanged. What explains this?
  • aOnly points on or inside the margin carry a nonzero dual coefficient, so distant rows contribute nothing.
  • bThe SVM averages all rows into a class prototype, and 40 rows barely move an average.
  • cThe solver caps the influence of any single row at C, so no row can move the plane much.
  • dRemoving rows lowers the effective regularization strength, which offsets the information lost.
Explanation:In the dual formulation each training point gets a coefficient alpha_i, and the KKT conditions force alpha_i = 0 for every point that lies strictly beyond its margin boundary. The decision function is a sum over support vectors only, so deleting well-separated points leaves it intact. This is also why SVMs are described as memory efficient: the fitted model stores just the support vectors.
Cml Svm Kernels MarginsDifficulty 2
A junior engineer wants "more regularization" from sklearn 1.6's SVC and changes C from 1.0 to 100.0, reasoning that a larger knob means a stronger penalty. What actually happens to the fitted model?
  • aNothing changes, because C only affects the solver's stopping rule.
  • bRegularization weakens: C multiplies the violation penalty, so the margin narrows to fit training points.
  • cRegularization strengthens exactly as intended, because C is the multiplier in front of the ||w||^2 term of the objective.
  • dThe model refuses to fit, because C above 10 is rejected as out of range.
Explanation:The primal objective is (1/2)||w||^2 + C * sum of hinge losses. C sits in front of the error term, not the norm term, so raising it makes each margin violation more expensive and pushes the solver toward a tighter, more complex boundary. The scikit-learn user guide states it directly: decreasing C corresponds to more regularization.
Cml Svm Kernels MarginsDifficulty 3
On a standardized 300-row dataset an RBF SVC is refit at several C values and n_support_.sum() is recorded: C=0.1 gives 288 support vectors, C=1 gives 196, C=10 gives 132, C=100 gives 105. Which mechanism produces this trend?
  • aLarger C shrinks the kernel cache, so fewer support vectors can be stored.
  • bLarger C prunes away the support vectors whose dual coefficient falls below the solver tolerance.
  • cLarger C reduces the number of iterations, so the solver finds fewer candidates.
  • dLarger C makes violations costly, the margin narrows and fewer points fall in.
Explanation:A point becomes a support vector when its functional margin is at most 1, which means it sits on or inside the margin band. A small C buys a wide band cheaply by tolerating many violations, so most rows end up inside it. Raising C makes each violation expensive, the solver squeezes the band, and only the few points still touching it keep a nonzero coefficient.

Test yourself against the 1050-question ML Engineer bank.

Start interview