liveBook · Manning

Minkowski distance

As explained in Outlier Detection in Python

Minkowski distance is a parameterized distance measure that aggregates powered coordinate differences and includes Manhattan and Euclidean distance as special cases.

Minkowski distance measures separation between numeric records by aggregating powered coordinate differences. Its power parameter selects related metrics: power 1 gives Manhattan distance, power 2 gives Euclidean distance, and larger powers emphasize the largest feature differences. section 9.7.1

Changing the power changes how coordinate differences influence the result:

  • Manhattan distance sums absolute coordinate differences, treating each feature difference directly. section 9.7.1
  • Euclidean distance squares differences before aggregation, so unusually large differences receive more influence. section 9.7.1
  • Higher powers increase that emphasis; the limiting infinity-power case is Chebyshev distance, determined by the maximum difference. section 9.7.1

Two three-feature records

For [0.1, 0.6, 0.2] and [0.5, 0.4, 0.7], the coordinate differences are 0.4, 0.2, and 0.5. Manhattan distance is 1.1; Euclidean distance applies squared differences and a square root, while other powers provide alternative emphasis. section 9.7.1

How Outlier Detection in Python covers it

How deep it goes
Defines the parameterized metric, compares powers, and works through coordinate differences without deriving internals.
Examples
Uses two three-feature rows, feature-wise differences, Manhattan distance, Euclidean distance, and a power-three comparison.
What you can do after
Apply it via SciPy, scikit-learn, PyOD, or BallTree by selecting a power appropriate to the distance behavior required.
How it connects
Connects Manhattan distance, Euclidean distance, Chebyshev distance, BallTree, kernel density estimation, KNN, and local outlier factor.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Outlier Detection in Python. The section links point to the parts of the book it draws on.