Adaptive Weighting For Flexible Estimation In Nonparametric Regression Models