GammaGammaModelIndividual.expected_customer_lifetime_value#

GammaGammaModelIndividual.expected_customer_lifetime_value(transaction_model, data, future_t=12, discount_rate=0.0, time_unit='D')[source]#

Compute the average lifetime value for a group of one or more customers.

In addition, it applies a discount rate for net present value estimations.

Note: future_t is always in months regardless of the time_unit used for the transaction model. The value is converted internally to the given time_unit for computing expected purchases per period.

Adapted from the legacy lifetimes library: CamDavidsonPilon/lifetimes

Parameters:
transaction_modelCLVModel

Predictive model for future transactions. BetaGeoModel, ModifiedBetaGeoModel, and ParetoNBDModel are currently supported.

dataDataFrame

DataFrame containing the following columns:

  • customer_id: Unique customer identifier

  • frequency: Number of repeat purchases observed for each customer

  • recency: Time between the first and the last purchase

  • T: Time between the first purchase and the end of the observation period

  • monetary_value: Mean spend values of repeat purchases for each customer

future_tint, optional

The number of months to project lifetime value for. This is always specified in months, independent of time_unit. Default: 12

discount_ratefloat, optional

The monthly adjusted discount rate. Default: 0.00

time_unitstr, optional

Unit of time of the purchase history. Defaults to “D” for daily. Other options are “W” (weekly), “M” (monthly), and “H” (hourly). Example: If your dataset contains information about weekly purchases, you should use “W”.

Returns:
xarray

DataArray containing estimated customer lifetime values