  Given an $n$-sample of random vectors $(X_i,Y_i)_{1 \leq i \leq n}$ whose
joint law is unknown, the long-standing problem of supervised classification
aims to \textit{optimally} predict the label $Y$ of a given a new observation
$X$. In this context, the nearest neighbor rule is a popular flexible and
intuitive method in non-parametric situations.
  Even if this algorithm is commonly used in the machine learning and
statistics communities, less is known about its prediction ability in general
finite dimensional spaces, especially when the support of the density of the
observations is $\mathbb{R}^d$. This paper is devoted to the study of the
statistical properties of the nearest neighbor rule in various situations. In
particular, attention is paid to the marginal law of $X$, as well as the
smoothness and margin properties of the \textit{regression function} $\eta(X) =
\mathbb{E}[Y | X]$. We identify two necessary and sufficient conditions to
obtain uniform consistency rates of classification and to derive sharp
estimates in the case of the nearest neighbor rule. Some numerical experiments
are proposed at the end of the paper to help illustrate the discussion.
