Principled Algorithms for Optimizing Generalized Metrics in Multi-Label Learning