google/lifetime_value

How are LTV distributions calculated?

JohanWork opened this issue · 1 comments

Thank you for making the code for the loss function, metrics and example notebooks open source.

From the last paragraph in section 3:

Another key advantage of the ZILN loss is that it provides a full prediction distribution. We obtain not only the probability of returning but also the value distribution of LTV for returning customers. In addition to mean LTV prediction, the uncertainty of LTV predictions can be assessed using quantiles of a lognormal distribution as in general quantile regression.

To me it is unclear both from checking the code examples and the paper, how the LTV prediction distributions are calculated, can you get them both for a singel predictions and a group of prediction for example?

Thank you!

Hi @JohanWork, AFAIK the library simply returns the mean of a LogNormal distribution. Check this method:

def zero_inflated_lognormal_pred(logits: tf.Tensor) -> tf.Tensor:

Since loc and scale (parameters of the LogNormal distribution) are returned by the DNN, one can also get not only the mean but any desired quantile. Check this for more details.