3
$\begingroup$

Hi all in the Mathematics for Machine Learning Book on page 375 they use the following equation to get the distance from the hyperplane

$\vec{x_a} = \vec{x_a'} + r \frac{\vec{w}} {\lVert{w}\lVert}$ Where $\vec{x_a'} $ is the projection on to the plane and $\vec{w}$ is the normal to the plane.

I can follow this, but I was wondering would it be wrong to just use the projection of $\vec{x_a}$ onto $\vec{w}$ instead? Doesn't this give me the $r \frac{\vec{w}} {\lVert{w}\lVert}$ directly?

And if that would be wrong, why? Thanks a lot in advance! I hope this isn't too silly a question.

$\endgroup$
1
  • $\begingroup$ Hmm, reading Hands on Machine Learning's Section on SVM I think I understand now that w is the weight vector we're trying to optimize, so we don't have it yet. In the MML book it read as if this vector is known. But I'm still not 100% sure if I understand correctly? $\endgroup$
    – Oliver
    Commented Feb 17, 2021 at 10:29

1 Answer 1

1
$\begingroup$

The projection $\vec{x_a} \cdot \frac{\vec{w}}{\lVert \vec{w} \rVert}$ gives you the distance from the origin along the direction given by $\vec{w}$, not from the class-separating hyperplane (except in the improbable case when the class boundary passes through the origin, in which case the two are equal).

In general, the class boundary is shifted by some value $b$ from the origin, so that:

$$ \vec{x_a} \cdot \frac{\vec{w}}{\lVert \vec{w} \rVert} = b + r $$

$\endgroup$
1
  • $\begingroup$ Thank you @Igor F. That makes sense, I was looking at it from the wrong angle! $\endgroup$
    – Oliver
    Commented Feb 17, 2021 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.