A representation-learning game for classes of prediction tasks