Weakly supervised learning from noisy data: from practice to theory