Top-$k$ Classification and Cardinality-Aware Prediction