Learning safe multi-label prediction for weakly labeled data