1. A classification method comprising: with a processor, for a new sample to be classified, for each of a set of classes, computing a comparison measure between a multidimensional representation of the new sample and a respective multidimensional class representation, the comparison measure being computed in a space of lower dimensionality than the multidimensional representation of the new sample by embedding the multidimensional representation of the new sample and the multidimensional class representations with a projection that has been learned on labeled samples to optimize classification of the labeled samples based on the comparison measure, each multidimensional class representation being computed based on a set of multidimensional representations of labeled samples that are labeled with the respective class; and assigning a class to the new sample based on the computed comparison measures.