yellowbrick icon indicating copy to clipboard operation
yellowbrick copied to clipboard

KS-Statistic Plot Visualizer

Open des137 opened this issue 5 years ago • 2 comments

As mentioned in the issue #1091, it would be nice to have a KS-Statistic plot visualizer within yellowbrick library.

Example:

from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression

cancer = load_breast_cancer()

X, y = cancer['data'][:, :4], cancer['target']
# Using only first four features from breast cancer dataset

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.33, random_state=42)

model = LogisticRegression()

Currently for plotting KS-Plot, I use scikitplot library, as follows:

import scikitplot as skplt
import matplotlib.pyplot as plt

y_probas = model.fit(X_train, y_train).predict_proba(X_test)

skplt.metrics.plot_ks_statistic(y_test, y_probas)
plt.show()

Expected Yellowbrick code:

from yellowbrick.classifier import KSPlot
visualizer = KSPlot(model)
visualizer.fit(X_train, y_train)
visualizer.score(X_test, y_test)
visualizer.show()

Output The graph below is the output of scikitplot library, but it would be nice to have a similar output from yellowbrick library.

ks-plot

des137 avatar Oct 04 '20 17:10 des137

I would second this request.

Also, the scikit-plot library is dead and there has been not a single commit from 2018. It can break anytime and there would be no bug fix or new feature implementations on that module.

This is the highly active module and new features are being implemented regularly.

bhishanpdl avatar Mar 09 '21 15:03 bhishanpdl

@des137 @bhishanpdl thank you both for using Yellowbrick and we're excited that you're excited about new visualizers! We don't have a lot of capacity as a group right now, but would certainly be glad for contributions. If you're interested, let me know and I'd be happy to chat about what might need to be done!

bbengfort avatar Apr 02 '21 00:04 bbengfort