BetaGeoBetaBinomModel.expected_purchases#

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

Predict expected number of future purchases.

Given recency, frequency, and T for an individual customer, this method estimates the expected number of future purchases across future_t time periods.

Adapted from equation (13) in Bruce Hardie’s notes [1], and 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