plot_frequency_recency_matrix#

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

Plot recency frequency matrix as heatmap. Plot a figure of expected transactions in T next units of time by a customer’s frequency and recency.

Parameters:
  • model (CLV model) – A fitted CLV model.

  • t (float, optional) – Next units of time to make predictions for

  • max_frequency (int, optional) – The maximum frequency to plot. Default is max observed frequency.

  • max_recency (int, optional) – The maximum recency to plot. This also determines the age of the customer. Default to max observed age.

  • title (str, optional) – Figure title

  • xlabel (str, optional) – Figure xlabel

  • ylabel (str, optional) – Figure ylabel

  • ax (plt.Axes, optional) – A matplotlib axes instance. Creates new axes instance by default.

  • kwargs – Passed into the matplotlib.imshow command.

Returns:

axes

Return type:

matplotlib.AxesSubplot