Dimensionality Reduction and (Bucket) Ranking: a Mass Transportation Approach