Learning Efficient Random Maximum A-Posteriori Predictors with Non-Decomposable Loss Functions