We want to recover a signal based on noisy inhomogeneous data (the amount of data can vary strongly on the estimation domain). We model the data using nonparametric regression with random design, and we focus on the estimation of the regression at a fixed point x 0 with little, or much data. We propose a method which adapts both to the local amount of data (the design density is unknown) and to the local smoothness of the regression function. The procedure consists of a local polynomial estimator with a Lepski type data-driven bandwidth selector, see for instance Lepski et al. [Ann. Statist.25 (1997) 929–947]. We assess this procedure in the minimax setup, over a class of function with local smoothness s >0 of Hölder type. We quantify the amount of data at x 0 in terms of a local property on the design density called regular variation, which allows situations with strong variations in the concentration of the observations. Moreover, the optimality of the procedure is proved within this framework.