Reconstructing social mixing patterns