In this paper, I consider a doubly stochastic Poisson process with intensity where is a continuous Itô semi‐martingale. Both processes are observed continuously over a fixed period . I propose a local polynomial estimator for the function on a given interval. Next, I propose a method to select the bandwidth in a nonasymptotic framework that leads to an oracle inequality. Considering the asymptotic , and , the accuracy of the proposed estimator over the Hölder class of order is if the degree of the chosen polynomial is greater than and it is optimal in the minimax setting. I apply those results to data on French temperature and electricity spot prices from which I infer the intensity of electricity spot spikes as a function of the temperature.