plot_expected_purchases_ppc#
- pymc_marketing.clv.plotting.plot_expected_purchases_ppc(model, ppc='posterior', max_purchases=10, samples=1000, random_seed=45, ax=None, **kwargs)[source]#
Plot a prior or posterior predictive check for the customer purchase frequency distribution.
ParetoNBDModel
,BetaGeoBetaBinomModel
,BetaGeoModel
andModifiedBetaGeoModel
are supported.Adapted from legacy
lifetimes
library: CamDavidsonPilon/lifetimes- Parameters:
- model
CLVModel
Prior predictive checks can be performed before or after a model is fit. Posterior predictive checks require a fitted model.
- ppc
str
, optional Type of predictive check to perform. Options are ‘prior’ or ‘posterior’; defaults to ‘posterior’.
- max_purchases
int
, optional Cutoff for bars of purchase counts to plot. Default is 10.
- samples
int
, optional Number of samples to draw for prior predictive checks. This is not used for posterior predictive checks.
- random_seed
int
, optional Random seed to fix sampling results
- ax
matplotlib.Axes
, optional A matplotlib Axes instance. Creates new axes instance by default.
- **kwargs
Additional arguments to pass into the pandas.DataFrame.plot command.
- model
- Returns:
- axes
matplotlib.AxesSubplot
- axes