On the interplay between data structure and loss function in classification problems