plot_frequency_recency_matrix#

pymc_marketing.clv.plotting.plot_frequency_recency_matrix(model, future_t=1, max_frequency=None, max_recency=None, title=None, xlabel="Customer's Historical Frequency", ylabel="Customer's Recency", ax=None, **kwargs)[source]#

Plot expected purchases in future_t time periods as a heatmap based on customer population frequency and recency.

Parameters:
  • model (BetaGeoModel | ParetoNBDModel) – CLV model: A fitted CLV model.

  • future_t (int) – float: Future time periods over which to run predictions.

  • optional – Future time periods over which to run predictions.

  • max_frequency (int | None) – int: The maximum frequency to plot. Defaults to max observed frequency.

  • optional – The maximum frequency to plot. Defaults to max observed frequency.

  • max_recency (int | None) – int: The maximum recency to plot. This also determines the age of the customer. Defaults to max observed recency.

  • optional – The maximum recency to plot. This also determines the age of the customer. Defaults to max observed recency.

  • title (str | None) – str: Figure title

  • optional – Figure title

  • xlabel (str) – str: Figure xlabel

  • optional – Figure xlabel

  • ylabel (str) – str: Figure ylabel

  • optional – Figure ylabel

  • ax (Axes | None) – plt.Axes: A matplotlib axes instance. Creates new axes instance by default.

  • optional – A matplotlib axes instance. Creates new axes instance by default.

  • kwargs – Passed into the matplotlib.imshow command.

Return type:

axes: matplotlib.AxesSubplot