ParetoNBDModel.expected_purchases#

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

Compute expected number of future purchases.

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

Adapted from equation (41) In Bruce Hardie’s notes [1], and lifetimes package: CamDavidsonPilon/lifetimes

Parameters:
dataDataFrame, 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 the first purchase and the end of the observation period. Model assumptions require T >= recency

  • future_t: Optional column for future_t parametrization.

  • All covariate columns specified when model was initialized.

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]

Fader, Peter & G. S. Hardie, Bruce (2005). “A Note on Deriving the Pareto/NBD Model and Related Expressions.” http://brucehardie.com/notes/009/pareto_nbd_derivations_2005-11-05.pdf