Sample complexity and effective dimension for regression on manifolds