BetaGeoModel.expected_probability_alive#

BetaGeoModel.expected_probability_alive(data=None)[source]#

Compute the probability a customer with history frequency, recency, and T is currently active.

The data parameter is only required for out-of-sample customers.

Adapted from page (2) in Bruce Hardie’s notes [1], and the legacy lifetimes library: CamDavidsonPilon/lifetimes

Parameters:
data*pandas.DataFrame

Optional dataframe containing the following columns:

  • customer_id: Unique customer identifier

  • frequency: Number of repeat purchases

  • recency: Time between the first and the last purchase

  • T: Time between first purchase and end of observation period, model assumptions require T >= recency

References

[1]

Fader, P. S., Hardie, B. G., & Lee, K. L. (2008). Computing P (alive) using the BG/NBD model. http://www.brucehardie.com/notes/021/palive_for_BGNBD.pdf.