Residuals-based distributionally robust optimization with covariate information