A locally adaptive bandwidth selector for kernel based regression