Learn Before
Concept

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 xix_i be the value of point X across the iith dimension, and let yiy_i be the value of point Y across the iith dimension (NOT to be confused with the conventional (x,y) notation for a point in 2D). Then, in nn dimensions, the Manhattan distance between points X and Y is d(X,Y)=i=1nxiyid(X,Y) = \sum_{i=1}^n|x_i - y_i|.

(Note that this is an instantiation of the Minkowski distance formula with p=1.)

0

1

Updated 2020-10-15

Tags

Data Science