ParetoNBDModel.distribution_new_customer_recency_frequency#

ParetoNBDModel.distribution_new_customer_recency_frequency(data=None, *, T=None, random_seed=None, n_samples=1000)[source]#

Pareto/NBD process representing purchases across the customer population.

This is the distribution of purchase frequencies given ‘T’ observation periods for each customer.

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, the method will use the fit dataset.

Tarray_like, optional

Number of observation periods for each customer. If not provided, T values from fit dataset will be used. Not required if data Dataframe contains a T column.

random_seedRandomState, optional

Random state to use for sampling.

n_samplesint, optional

Number of samples to generate. Defaults to 1000.

Returns:
Dataset

Dataset containing the posterior samples for the customer population.