15.3 Feature scaling
Since we now have dimensions, it makes sense that geometry will enter the picture. If I have two points in the Cartesian plane, v = (v1, v2) and w = (w1, w2), then the Euclidean distance, or simply distance, between them is
For example, the distance between (-3, -1) and (2, 1.5) is approximately 5.6. Note the double bars around the difference of the points.
In words, we say that the distance between any two points is the square root of the sum of the squares of the differences between corresponding coordinates. In three dimensions, the distance formula is
for points (v1, v2, v3) and (w1, w2, w3). Note the convention of using a bold italic font for the point when it has two or more dimensions: v = (v1, v2, v3).
These are generalizations of the formula for the distance between two numbers, v and w, on a line, which...