Learn Before
Manhattan Distance (p=1)
Manhattan distance, aka city block distance, is the number of units one must traverse to get from point X to point Y along a grid-like path. In other words, each step involves a change in value across exactly one dimension. In machine learning, Manhattan distance is preferred (over higher values of p) for high-dimensionality data because of simpler computation and because of something called the "curse of high dimensionality."
More formally, let be the value of point X across the th dimension, and let be the value of point Y across the th dimension (NOT to be confused with the conventional (x,y) notation for a point in 2D). Then, in dimensions, the Manhattan distance between points X and Y is .
(Note that this is an instantiation of the Minkowski distance formula with p=1.)
0
1
Tags
Data Science