ParetoNBDModel.distribution_new_customer#

ParetoNBDModel.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 data is 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:
dataDataFrame, Optional

DataFrame containing the following columns:

  • customer_id: Unique customer identifier

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

  • All covariate columns specified when model was initialized.

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 data parameter is provided with a T column.

random_seedRandomState, 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_samplesint, optional

Number of samples to generate. Defaults to 1000