sklift.viz.plot_uplift_curve

sklift.viz.base.plot_uplift_curve(y_true, uplift, treatment, random=True, perfect=True, ax=None, name=None, **kwargs)[source]

Plot Uplift curves from predictions.

Parameters
  • y_true (1d array-like) – Ground truth (correct) binary labels.

  • uplift (1d array-like) – Predicted uplift, as returned by a model.

  • treatment (1d array-like) – Treatment labels.

  • random (bool) – Draw a random curve. Default is True.

  • perfect (bool) – Draw a perfect curve. Default is True.

  • ax (object) – The graph on which the function will be built. Default is None.

  • name (string) – The name of the function. Default is None.

Returns

Object that stores computed values.

Example:

from sklift.viz import plot_uplift_curve


uplift_disp = plot_uplift_curve(
    y_test, uplift_predicted, trmnt_test,
    perfect=True, name='Model name'
);

uplift_disp.figure_.suptitle("Uplift curve");