Data Science, Machine Learning, Support Vector Machine, Python.
we divide the dot product of w with (x1-x2) by the norm of w, we are basically projecting the distance between x1 and x2 in a direction perpendicular. To understand a bit more why we need to do this, consider the following: the dot product of two vectors gives us the projection of one vector onto