Learning with biased data: invariant representations and target labels