ROC Report#


import warnings

import pandas as pd
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split

from deepchecks.tabular import Dataset
from deepchecks.tabular.checks.performance import RocReport

def custom_formatwarning(msg, *args, **kwargs):
    return str(msg) + '\n'

warnings.formatwarning = custom_formatwarning

Generating data#

iris = load_iris(as_frame=True)
clf = LogisticRegression(penalty='none')
frame = iris.frame
X =
y =
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=55), y_train)
ds = Dataset(pd.concat([X_test, y_test], axis=1),

Running roc_report Check#

check = RocReport(), clf)

ROC Report

Calculate the ROC curve for each class.

Additional Outputs
The marked points are the optimal threshold cut-off points. They are determined using Youden's index defined as sensitivity + specificity - 1

Total running time of the script: ( 0 minutes 0.035 seconds)

Gallery generated by Sphinx-Gallery