An example showing the plot_lift_curve method

In this example, we'll be plotting a lift curve to describe the classification performance of a LogisticRegression classifier using the breast cncer dataset from scikit-learn. Here, we'll be using the scikitplot.metrics.plot_lift_curve method.


In [3]:
%matplotlib inline
"""
An example showing the plot_lift_curve method used
by a scikit-learn classifier
"""
from __future__ import absolute_import
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import load_breast_cancer as load_data
# Import scikit-plot
import scikitplot as skplt

In [4]:
X, y = load_data(return_X_y=True)
lr = LogisticRegression()
lr.fit(X, y)
probas = lr.predict_proba(X)
skplt.metrics.plot_lift_curve(y_true=y, y_probas=probas)
plt.show()