  This article is devoted to the problem of predicting the value taken by a
random permutation $\Sigma$, describing the preferences of an individual over a
set of numbered items $\{1,\; \ldots,\; n\}$ say, based on the observation of
an input/explanatory r.v. $X$ e.g. characteristics of the individual), when
error is measured by the Kendall $\tau$ distance. In the probabilistic
formulation of the 'Learning to Order' problem we propose, which extends the
framework for statistical Kemeny ranking aggregation developped in
\citet{CKS17}, this boils down to recovering conditional Kemeny medians of
$\Sigma$ given $X$ from i.i.d. training examples $(X_1, \Sigma_1),\; \ldots,\;
(X_N, \Sigma_N)$. For this reason, this statistical learning problem is
referred to as \textit{ranking median regression} here. Our contribution is
twofold. We first propose a probabilistic theory of ranking median regression:
the set of optimal elements is characterized, the performance of empirical risk
minimizers is investigated in this context and situations where fast learning
rates can be achieved are also exhibited. Next we introduce the concept of
local consensus/median, in order to derive efficient methods for ranking median
regression. The major advantage of this local learning approach lies in its
close connection with the widely studied Kemeny aggregation problem. From an
algorithmic perspective, this permits to build predictive rules for ranking
median regression by implementing efficient techniques for (approximate) Kemeny
median computations at a local level in a tractable manner. In particular,
versions of $k$-nearest neighbor and tree-based methods, tailored to ranking
median regression, are investigated. Accuracy of piecewise constant ranking
median regression rules is studied under a specific smoothness assumption for
$\Sigma$'s conditional distribution given $X$.
