ParetoNBDModel.expected_probability_alive#

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

Compute 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 (18) in Bruce Hardie’s notes [3].

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 in the future to estimate alive probability; defaults to 0.

    • 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 in the future to estimate alive probability; defaults to 0. Not needed if data parameter is provided with a future_t column.

Return type:

DataArray

References