BetaGeoBetaBinomModel.expected_probability_alive#

BetaGeoBetaBinomModel.expected_probability_alive(data=None, *, future_t=None)[source]#

Predict expected probability of being alive.

Estimate the probability that a customer with history frequency, recency, and T is currently active. Can also estimate alive probability for future_t periods into the future.

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

Parameters:
dataDataFrame, optional

Dataframe containing the following columns:

  • customer_id: Unique customer identifier

  • frequency: Number of repeat purchases

  • recency: Purchase opportunities between the first and the last purchase

  • T: Total purchase opportunities. Model assumptions require T >= recency and all customers share the same value for *T.

  • future_t: Optional column for future_t parametrization.

If not provided, predictions will be ran with data used to fit model.

future_tarray_like

Number of time periods to predict expected purchases. Not required if data Dataframe contains a future_t column.

References

[1]

Peter Fader, Bruce Hardie, and Jen Shang. “Customer-Base Analysis in a Discrete-Time Noncontractual Setting”. Marketing Science, Vol. 29, No. 6 (Nov-Dec, 2010), pp. 1086-1108. https://www.brucehardie.com/papers/020/fader_et_al_mksc_10.pdf