Consistent Classification with Generalized Metrics