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_tis always in months regardless of thetime_unitused for the transaction model. The value is converted internally to the giventime_unitfor computing expected purchases per period.Adapted from the legacy
lifetimeslibrary: CamDavidsonPilon/lifetimes- Parameters:
- transaction_model
CLVModel Predictive model for future transactions.
BetaGeoModel,ModifiedBetaGeoModel, andParetoNBDModelare currently supported.- data
DataFrame DataFrame containing the following columns:
customer_id: Unique customer identifierfrequency: Number of repeat purchases observed for each customerrecency: Time between the first and the last purchaseT: Time between the first purchase and the end of the observation periodmonetary_value: Mean spend values of repeat purchases for each customer
- future_t
int, optional The number of months to project lifetime value for. This is always specified in months, independent of
time_unit. Default: 12- discount_rate
float, optional The monthly adjusted discount rate. Default: 0.00
- time_unit
str, 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”.
- transaction_model
- Returns:
xarrayDataArray containing estimated customer lifetime values