---
title: Use the ROC Curve tools
description: Learn how to access the visualization tools available on the ROC Curve tab.
---

# Use the ROC Curve tools {: #use-the-roc-curve-tools }

The **ROC Curve** tools provide visualizations and metrics to help you determine whether the classification performance of a particular model meets your specifications. It is important to understand that the **ROC Curve** and other charts on that tab are based on a _sample_ of calculated thresholds. That is, DataRobot calculates thresholds for all data and then, because sampling provides faster performance (returns results in the UI more quickly), it uses a maximum of 120 thresholds&mdash;a quantile-based representative selection&mdash;for the visualizations. Manual calculations are slightly more precise, therefore, the initial auto-generated calculations and the manually generated will not match exactly.

??? tip "Benefits of ROC curve visualizations"
	 Models produce probabilities, values anywhere from 0 to 1, with millions if not 10s or 100s of millions of unique possibilities. The action you take based on model results, however, is binary&mdash;you either send an offer or you don’t, for example. To "convert" all those probabilities to a binary action, you select a threshold (“any probability above X% and I send the offer”). The threshold creates two values&mdash;false positives and true positives, which can be plotted on a graph. The number of false and true positives vary as you change your threshold. A very low threshold results in a lot of false positives, whereas a high threshold provides none.

	Conceptually, the best outcome (and what a good model will give you) is low false positives and high true positives. If you look at an ROC curve, points in the upper left are what you want, as they represent low false positive, high true positive. A model that does no better than a coin flip will show a 45-degree line.

## Access the ROC Curve tools {: #access-the-roc-curve-tools }

1. To access the **ROC Curve** tab, navigate to the **Leaderboard**, select the model you want to evaluate, then click **Evaluate > ROC Curve**. The **ROC Curve** tab contains the set of interactive graphical displays described below.

    ![](images/roc-tab-overview-callouts.png)

    !!! tip

        {% include 'includes/slices-viz-include.md' %}


    |  | Element | Description |
    |---|---|---|
    | ![](images/icon-1.png) | Data Selection | [Select the data source](threshold#select-data-for-visualizations) for your visualization. Data sources can be partitions&mdash;**Holdout**, **Cross Validation**, and **Validation**&mdash;as well as external test data. Once you select a data source, the ROC curve visualizations update to reflect the new data.|
    | ![](images/icon-2.png) | [Data slice](sliced-insights) | _Binary classification only_. Selects the filter that defines the subpopulation to display within the insight.|
    | ![](images/icon-3.png) | Display Threshold | Select a [display threshold](threshold#set-the-display-threshold) that separates predictions classified as "false" from predictions classified as "true."  |
    | ![](images/icon-4.png) | Export | Export to a CSV, PNG, or ZIP file: <ul><li>Download the data from your generated ROC Curve or Profit Curve as a CSV file.</li><li>Download a PNG of a ROC Curve, Profit Curve, Prediction Distribution graph, Cumulative Gain chart, or a Cumulative Lift chart.</li><li>   Download a ZIP file containing all of the CSV and PNG files.</li></ul> See also [Export charts and data](export-results#export-charts-and-data). |
    | ![](images/icon-5.png) | Prediction Distribution | Use the [Prediction Distribution](pred-dist-graph) graph to evaluate how well your classification model discriminates between the positive and negative classes. The graph separates predictions classified as "true" from predictions classified as "false" based on the prediction threshold you set. |
    | ![](images/icon-6.png) | Chart selector | Select a type of chart to display. Choose from ROC Curve (default), Average Profit, Precision Recall, Cumulative Lift (Positive/Negative), and Cumulative Gain (Positive/Negative). You can also create your own [custom chart](custom-charts).|
    | ![](images/icon-7.png) | Matrix selector | Select a type of matrix to display. By default, a [confusion matrix](confusion-matrix) displays. You can choose to display the confusion matrix data by instance counts or percentages.  You can instead create a payoff matrix so that you can generate and view a [profit curve](profit-curve).|
    | ![](images/icon-8.png) | + Add payoff | Enter payoff values to generate a [profit curve](profit-curve) so that you can estimate the business impact of the model. Clicking **Add payoff** displays a **Payoff Matrix** in the **Matrix** pane if not already displayed. Adjust the **Payoff** values in the matrix and set the **Chart** pane to **Average Profit** to view the impact. |
    | ![](images/icon-9.png) | Metrics | View summary statistics that describe model performance at the selected threshold. Use the **[Select metrics](metrics)** menu to choose up to six metrics to display at one time. |

2. To use these components, select a [data source and a display threshold](threshold) between predictions classified as "true" or "false"&mdash;each component works together to provide an interactive snapshot of the model's classification behavior based on that threshold.

    ![](images/roc-tab-overview-data-threshold.png)

!!! note
    Several [Wikipedia pages](https://en.wikipedia.org/wiki/Receiver_operating_characteristic){ target=_blank } and the Internet in general provide thorough descriptions explaining many of the elements provided by the **ROC Curve** tab. Some are summarized in the sections that follow.

## Classification use cases {: #classification-use-cases }

The following sections use one of two binary classification use cases to illustrate the concepts described. In both cases, each row in the dataset represents a single patient, and the features (columns) contain descriptive variables about the patient's medical condition.

The ROC curve is a graphical means of illustrating classification performance for a model as the relevant performance statistics at all points on the probability scale change. To understand the reported statistics, you must understand the  four possible outcomes of a classification problem; these outcomes are the basis of the [confusion matrix](confusion-matrix).

### Classification use case 1 {: #classification-use-case-1 }

Use case 1 asks "Does a patient have diabetes?" This hypothetical dataset has both categorical and numeric values and describes whether a patient has diabetes. The target variable, `has_diabetes`, is a categorical value that describes whether the patient has the disease (`has_diabetes=1`) or does not have the disease (`has_diabetes=0`). Numeric and other categorical variables describe factors like blood pressure, payer code, number of procedures, days in hospital, and more. For use case 1:

|   Outcome   |  Description |
|-------------|--------------|
| True positive (TP)  | A positive instance that the model correctly classifies as positive. For example, a diabetic patient correctly identified as diabetic.    |
| False positive (FP) | A negative instance that the model incorrectly classifies as positive. For example, a healthy patient incorrectly identified as diabetic. |
| True negative (TN)  | A negative instance that the model correctly classifies as negative. For example, a healthy patient correctly identified as healthy.      |
| False negative (FN) | A positive instance that the model incorrectly classifies as negative. For example, a diabetic patient incorrectly identified as healthy. |

The following points provide some statistical reasoning behind using the outcomes:

* Correct predictions: ![](images/dnt-correct.png)
* Incorrect predictions: ![](images/dnt-incorrect.png)
* Total scored cases: ![](images/dnt-total-scores.png)
* Error rate: ![](images/dnt-error-rate.png)
* Overall accuracy (probability a prediction is correct): ![](images/dnt-overall-accuracy.png)

### Classification use case 2 {: #classification-use-case-2 }

Use Case 2 is a model that tries to determine whether a diabetic patient will be readmitted to hospital (the target feature). This hypothetical dataset has both categorical and numeric values and describes whether a patient will be readmitted to the hospital within 30 days (target `variable=readmitted`). This categorical value describes whether the patient is readmitted inside of 30 days (`readmitted=1`) or is not readmitted within that time frame (`readmitted=0`); other categorical values include things like admission id and payer code. Numeric variables describe things like blood pressure, number of procedures, days in hospital, and more.

!!! note
    DataRobot displays the **ROC Curve** tab only for models created for a binary classification target (a target with two unique values).