ParetoNBDModel.expected_purchases#

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

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 [2], and lifetimes package: CamDavidsonPilon/lifetimes

Parameters:
  • data (pd.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 the first purchase and the end of the observation period.

      Model assumptions require T >= recency

    • future_t: Number of time periods to predict expected purchases.

    • covariates: Purchase and dropout covariate columns if original model had any.

    If not provided, the method will use the fit dataset.

  • future_t (array_like, optional) – Number of time periods to predict expected purchases. Not needed if data parameter is provided with a future_t column.

Return type:

DataArray

References