Structured learning for social group detection