ROC Report#

This notebook provides an overview for using and understanding the ROC Report check.


What is the ROC Report check?#

The ROCReport check calculates the ROC curve for each class. The ROC curve is a plot of TPR (true positive rate) with respect to FPR (false positive rate) at various thresholds (ROC curve).


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 import RocReport

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

warnings.formatwarning = custom_formatwarning

Generate data & model#

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),

Run the Check#

check = RocReport(), clf)
ROC Report

Define a condition#

A condition for minimum allowed AUC score per class can be defined. Here, we define minimum AUC score to be 0.7.

check = RocReport()
check.add_condition_auc_greater_than(0.7).run(ds, clf)
ROC Report

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

Gallery generated by Sphinx-Gallery