# Modeling delayed feedback using logistic regression

Suppose we are trying to model the probability of a user clicking on an ad using logistic regression. We will receive only the positive feedback so, we define $Y = 1$ when success was observed, $Y=0$ otherwise.

We define the probability of click for a set of features $X$ as $$P(y_i=1|X=x_i) = \frac{1}{1+e^{-wx_i}}$$

Now suppose that you should predict the probability of click in real-time, one-by-one when the ad is displayed but the feedback will be delayed. And, in the same way, when you retrieve the data for training you will have actions with no feedback and therefore marked as $Y=0$ but you could receive positive feedback hours later and the label will change to $Y=1$.

Note that the data is non stationary because new features values (or instances) can appear within minutes, so training with data old enough to make sure that you received all the possible positive feedback is not an option.

Here is an example showing the cumulative amount of clicks received per hours. As you can see we have received almost 25% of clicks in the first hour and the 85% in the 10th.

The image is showing the actual decay (in red) and the exponential decay we are using to model it (in yellow). Following:

$$N(t) = N_0 · e^{-\lambda t}\\ \lambda=-ln(0.15)/C\\$$

where $N_0$ is the initial point and $C$ is elapsed hours to 85% (that's why $\lambda$ is computed using 0.15)

In this paper Modeling Delayed Feedback in Display Advertising they introduced the delay into the model itself but I am trying to use the exponential decay to model the output variable of the logistic regression for simplicity (I though it'd be easier to change labels than rewrite the optimizer). So, instead of

$$y = \left\{\begin{matrix} 1 & \text{success observed}\\ 0 & \text{otherwise} \end{matrix}\right.$$

I am trying to train the model using

$$y = \left\{\begin{matrix} 1 & \text{success observed}\\ N_0 · e^{-\lambda t} & \text{otherwise} \end{matrix}\right.$$

and setting $N_0$ as the average successful rate.

The problem is that I haven't seen any place where this method was used and I don't know if I am doing something terribly wrong.

• Is this approach valid?
• Any suggestion or different approach to introduce the delayed feedback in a logistic regression model?
• Logistic regression is good fitting binomial distributions but here I am using soft labels ($y \in (0, 1)$ instead of $y \in \{0, 1\}$). Is this approach valid or logistic regression isn't gonna work well?
• I think you have to step back and explain your problem more. What exactly is non stationary etc. If you are making predictions at multiple times how do you associate success with one particular time.? – seanv507 Jul 7 '17 at 15:09
• You don't receive the failures, right ? – Benoit Sanchez Jul 7 '17 at 15:18
• @seanv507 the data is non stationary because new features values (or instances) can appear. I made predictions in real-time, one-by-one and I will receive the feedback using IDs to match. I will try to edit the question adding these points but fill free to edit it meanwhile! – decay Jul 7 '17 at 15:28
• @BenoitSanchez You are right. I just receive the positive feedback. – decay Jul 7 '17 at 15:29
• I deleted my answer because I realized the problem was more difficult than I thought. It is very interesting. However I think there are too many points for a single question : estimating a truncated exponential distribution with additional condition ($p$) is already uneasy (a latent variable model) and if you add the logistic thing ($X$) then it becomes a full research topic. I haven't read the article fully, but I looks rather "inevitable": on my own I get similar formulas as they do. I don't think there is an easier way. – Benoit Sanchez Jul 10 '17 at 12:57