Social Aggregation and Learning with Heterogeneous Agents