KatInterview

Rescaling Vectors by Sum of Magnitudes vs Euclidean Length

Machine LearningModel answer
MediumModel answerMachine Learningnormalizationl1-norml2-norm

Last updated

Compare dividing a vector by its L1 norm versus its L2 norm: definitions, geometry, a worked example, edge cases, and when each rescaling suits a machine learning task.

You are asked to explain, as you would in a spoken technical discussion, how rescaling a vector by its L1 norm differs from rescaling it by its L2 norm.

Your answer should:

  1. Define both norms and the vector each rescaling produces.
  2. Work through a small numeric example that makes the difference visible.
  3. Describe what each rescaled vector represents geometrically and what downstream uses it supports.
  4. Explain how each behaves when one component dominates, when values are negative, and when the vector is all zeros.
  5. Keep this topic clearly separate from L1/L2 regularization of model weights and from per-feature standardization (z-scoring).

Before answering, state which interpretation you are using. If the question is ambiguous, say so, and also say whether the rescaling is applied per sample (row) or per feature (column).

Hints

Hint 1

Write both formulas side by side: the L1 norm sums absolute values, the L2 norm is the square root of the sum of squares. Normalizing means dividing the vector by the chosen norm.

Hint 2

Pick a vector like (3, -4) or (1, 2, 2, 5). Compute both results and check what is guaranteed afterward: which quantity equals 1 in each case?

Hint 3

Think about what each result is used for: L1-normalized nonnegative vectors behave like distributions, while L2-normalized vectors lie on the unit sphere, where dot product equals cosine similarity.

Hint 4

Do not forget the zero vector (division by zero) and the fact that normalization of data is a preprocessing step, unlike regularization, which adds a penalty to the loss.