Probabilistic n-Choose-k Models for Classification and Ranking