BaseGammaGammaModel.expected_customer_lifetime_value#
- BaseGammaGammaModel.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 measured in months regardless oftime_unitspecified.Adapted from lifetimes package CamDavidsonPilon/lifetimes
- Parameters:
- transaction_model
CLVModel Predictive model for future transactions.
BetaGeoModelandParetoNBDModelare 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 lifetime expected for the user in months. 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