promptdojo_

Dimensionality and distance traps — step 5 of 7

This nearest-neighbor lookup says maya's closest peer is riley — a user with 4.5x her activity — purely because their incomes are near. Dollars dwarf login counts, so income owns the raw distance. Fix it by standardizing each column to z-scores ((value - column mean) / column std, population std) before measuring distance; with both columns on equal footing, the behavior twin marcus wins.

The break is on line 12 — but read the whole snippet first.

full-screen editor opens — close anytime to keep reading.