plot_lift_decile_wise#

scikitplot.kds.plot_lift_decile_wise(y_true, y_probas, *, class_index=1, title='Decile-wise Lift Plot', ax=None, fig=None, figsize=None, title_fontsize='large', text_fontsize='medium', **kwargs)#

Generates the Decile-wise Lift Plot from labels and probabilities

The lift curve is used to determine the effectiveness of a binary classifier. A detailed explanation can be found at http://www2.cs.uregina.ca/~dbd/cs831/notes/lift_chart/lift_chart.html The implementation here works only for binary classification.

Parameters:
  • y_true (array-like, shape (n_samples,)) – Ground truth (correct) target values.

  • y_probas (array-like, shape (n_samples, n_classes)) – Prediction probabilities for each class returned by a classifier.

  • title (str, optional, default='Decile-wise Lift Plot') – Title of the generated plot.

  • title_fontsize (str or int, optional, default=14) – Font size for the plot title. Use e.g., “small”, “medium”, “large” or integer-values (8, 10, 12, etc.).

  • text_fontsize (str or int, optional, default=10) – Font size for the text in the plot. Use e.g., “small”, “medium”, “large” or integer-values (8, 10, 12, etc.).

  • figsize (tuple of int, optional, default=None) –

    Tuple denoting figure size of the plot (e.g., (6, 6)).

    Added in version 0.3.9.

Returns:

The axes with the plotted Decile-wise Lift curves.

Return type:

matplotlib.axes.Axes

See also

plot_lift

Generates the Decile based cumulative Lift Plot from labels and probabilities.

References

[1] tensorbored/kds

Examples

>>> import scikitplot as skplt
>>> from sklearn.datasets import load_iris
>>> from sklearn.model_selection import train_test_split
>>> from sklearn.tree import DecisionTreeClassifier
>>> X, y = load_iris(return_X_y=True)
>>> X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=0)
>>> clf = DecisionTreeClassifier(max_depth=1, random_state=0)
>>> clf = clf.fit(X_train, y_train)
>>> y_prob = clf.predict_proba(X_test)
>>> skplt.kds.plot_lift_decile_wise(y_test, y_prob, class_index=1)

(Source code, png)

Lift Decile Wise Curves