Density estimation and nonparametric regression on irregular