# What is Mahalanobis distance, & how is it used in pattern recognition?

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?

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}