Ensemble Prediction via Covariate-dependent Stacking