BetaGeoModel.distribution_new_customer#
- BetaGeoModel.distribution_new_customer(data=None, *, T=None, random_seed=None, var_names=('dropout', 'purchase_rate', 'recency_frequency'), n_samples=1000)[source]#
Compute posterior predictive samples of dropout, purchase rate and frequency/recency of new customers.
In a model with covariates, if
datais not specified, the dataset used for fitting will be used and a prediction will be computed for a new customer with each set of covariates. This is not a conditional prediction for observed customers!- Parameters:
- data
DataFrame,Optional DataFrame containing the following columns:
customer_id: Unique customer identifierT: Time between the first purchase and the end of the observation period
If not provided, predictions will be ran with data used to fit model.
- Tarray_like, optional
time between the first purchase and the end of the observation period. Not needed if
dataparameter is provided with aTcolumn.- random_seed
RandomState, optional Random state to use for sampling.
- var_namessequence of
str, optional Names of the variables to sample from. Defaults to [“dropout”, “purchase_rate”, “recency_frequency”].
- n_samples
int, optional Number of samples to generate. Defaults to 1000
- data