DelayedSaturatedMMM.plot_direct_contribution_curves#

DelayedSaturatedMMM.plot_direct_contribution_curves(show_fit=False, xlim_max=None, method='sigmoid', channels=None, same_axes=False)#

Plots the direct contribution curves for each marketing channel. The term “direct” refers to the fact we plot costs vs immediate returns and we do not take into account the lagged effects of the channels e.g. adstock transformations.

Parameters:
  • show_fit (bool, optional) – If True, the function will also plot the curve fit based on the specified method. Defaults to False.

  • xlim_max (int, optional) – The maximum value to be plot on the X-axis. If not provided, the maximum value in the data will be used.

  • method (str, optional) – The method used to fit the contribution & spent non-linear relationship. It can be either ‘sigmoid’ or ‘michaelis-menten’. Defaults to ‘sigmoid’.

  • channels (List[str], optional) – A list of channels to plot. If not provided, all channels will be plotted.

  • same_axes (bool, optional) – If True, all channels will be plotted on the same axes. Defaults to False.

Returns:

A matplotlib Figure object with the direct contribution curves.

Return type:

plt.Figure