sklift.metrics.treatment_balance_curve

sklift.metrics.metrics.treatment_balance_curve(uplift, treatment, winsize)[source]

Compute the treatment balance curve: proportion of treatment group in the ordered predictions.

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

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

  • winsize (int) – Size of the sliding window for calculating the balance between treatment and control.

Returns

Points on a curve.

Return type

array (shape = [>2]), array (shape = [>2])