Normalize a short vector to unit length
Preserve the order of coordinates and the signs of values. · 157 words
A vector is an ordered list of numbers. An AI search model may turn a text record into a vector of feature scores. Its length, called the norm, is found by adding the squares of the entries and taking the square root. For (3,4), the norm is sqrt(3*3+4*4)=5. Normalizing means dividing every entry by that norm, giving (3/5,4/5)=(0.6,0.8). This new vector has length 1 because 0.6*0.6+0.8*0.8=1. Normalization keeps the direction but removes scale, so scores of different sizes can be compared fairly.
A robot sorting books by cover color gives another example. Suppose a camera represents a blue marker by the vector (0,-5,12). Its norm is sqrt(0*0+(-5)*(-5)+12*12)=13, so the unit vector is (0,-5/13,12/13). The direction is unchanged, but the magnitude is no longer included. When a recommendation model compares vectors using dot products or angles, this prevents a large scale from dominating the result. In a feature matrix, each normalized vector can be stored as one row.
Check your recall
What is the unit-length version of the vector (3,4), and how can you verify it?
Check your answer
Divide each entry by the norm 5, giving (0.6,0.8). It has unit length because 0.6*0.6+0.8*0.8=1.
Sources and credits
Original KeyTouch lesson. Background reading · Zhang et al. · Linear Algebra.