Machine Learning – How to Use Mahalanobis Distance in Pattern Recognition

distance-functionsmachine learningmathematical-statistics

Can someone explain to me the concept of Mahalanobis distance? For example, what is the Mahalanobis distance between two points x and y, and especially, how is it interpreted for pattern recognition?

Best Answer

Mahalanobis distance provides a way to measure how similar some set of conditions is to a known set of conditions. It accounts the covariance among variables.

It is calculated as: $$ D^2=(\bf x-m)^TC^{-1}(x-m) $$ where: \begin{align} D^2 &= \text{Mahalanobis distance} \\ {\bf x} &= \text{Vector of data} \\ {\bf m} &= \text{Vector of mean values of independent variables} \\ {\bf C^{-1}} &= \text{Inverse Covariance matrix of independent variables} \\ {\bf T} &= \text{Indicates vector should be transposed} \\ \end{align}

This page provides a detailed explanation (with examples from landscape analysis).