Regression in heterogeneous problems