How can feature units change a nearest-neighbor result?

Instruction: A query is (age 30 years, income 50,000 dollars). Candidate A is (31, 60,000) and candidate B is (40, 50,100). Compare squared Euclidean distances before and after dividing age differences by 10 years and income differences by 10,000 dollars. Explain where learned scales must be fitted.

Context: Assesses the effect of units on a distance-based model and the boundary between training and evaluation preprocessing.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

Without scaling, A has squared distance 1² + 10,000² = 100,000,001. B has squared distance 10² + 100² = 10,100, so B is nearer. Dollars dominate this comparison because of their units, not because income has been proven more important.

With the supplied scales, A has squared distance (1/10)² + (10,000/10,000)² = 1.01...

Related Questions