---
title: Set up fairness monitoring
description: Configure fairness monitoring on a deployment's Fairness Settings tab.

---

# Set up fairness monitoring

On a deployment's **Fairness > Settings** tab, you can define [Bias and Fairness](fairness-metrics) settings for your deployment to identify any biases in a binary classification model's predictive behavior. If fairness settings are defined prior to deploying a model, the fields are automatically populated. For additional information, see the section on [defining fairness tests](fairness-metrics#configure-metrics-and-mitigation).

!!! note
    To configure fairness settings, you must enable target monitoring for the deployment. Target monitoring allows DataRobot to monitor how the values and distributions of the target change over time by storing prediction statistics. If target monitoring is turned off, a message displays on the **Fairness** tab to remind you to enable [target monitoring](data-drift-settings).

Configuring fairness criteria and notifications can help you identify the root cause of bias in production models. On the **Fairness** tab for individual models, DataRobot calculates per-class bias and fairness over time for each protected feature, allowing you to understand why a deployed model failed the predefined acceptable bias criteria. For information on fairness metrics and terminology, see the [Bias and Fairness reference page](bias-ref).

To measure the fairness of production models, you must configure bias and fairness testing in the **Fairness > Settings** tab of a deployed model. If bias and fairness testing was configured for the model prior to deployment, the fields are automatically populated.

On a deployment's **Fairness Settings** page, you can configure the following settings:

![](images/fairness-settings.png)

| Field                    | Description                |
|--------------------------|----------------------------|
|  **Segmented Analysis**  | :~~: |
| [Track attributes for segmented analysis of training data and predictions](deploy-segment)  | Enables DataRobot to monitor deployment predictions by segments, for example by categorical features. |
|  **Fairness**            | :~~: |
| [Protected features](glossary/index#protected-feature) | Selects each protected feature's dataset column to measure fairness of model predictions against; these features must be categorical. |
| [Primary fairness metric](#select-a-fairness-metric)  | Selects the statistical measure of parity constraints used to assess fairness. |
| Favorable target outcome | Selects the outcome value perceived as favorable for the protected class relative to the target. |
| Fairness threshold       | Selects the fairness threshold to measure if a model performs within appropriate fairness bounds for each protected class. |
|  **Association ID**      | :~~: |
| Association ID           | Defines the name of the column that contains the association ID in the prediction dataset for your model. An association ID is required to calculate two of the **Primary fairness metric** options: _True Favorable Rate & True Unfavorable Rate Parity_ and _Favorable Predictive & Unfavorable Predictive Value Parity_. The association ID functions as an identifier for your prediction dataset so you can later match up outcome data (also called "actuals") with those predictions. |
| Require association ID in prediction requests | Requires your prediction dataset to have a column name that matches the name you entered in the Association ID field. When enabled, you will get an error if the column is missing. |
|  **Definition**           | :~~: |
| [Set definition](#define-fairness-monitoring-notifications) | Configures the number of protected classes below the fairness threshold required to trigger monitoring notifications. |
|  **Notifications**           | :~~: |
| [Send notification](#schedule-fairness-monitoring-notifications) | Configures the schedule for fairness monitoring notification checks. |

## Select a fairness metric {: #select-a-fairness-metric }

DataRobot supports the following fairness metrics in MLOps:

* [Equal Parity](bias-ref#equal-parity)

* [Proportional Parity](bias-ref#proportional-parity)

* [Prediction Balance](bias-ref#prediction-balance)

* [True Favorable](bias-ref#true-favorable-rate-parity) and [True Unfavorable](bias-ref#true-unfavorable-rate-parity) Rate Parity (_True Positive Rate Parity and True Negative Rate Parity_)

* [Favorable Predictive](bias-ref#favorable-predictive-value-parity) and [Unfavorable Predictive](bias-ref#unfavorable-predictive-value-parity) Value Parity (_Positive Predictive Value Parity and Negative Predictive Value Parity_)

If you are unsure of the appropriate fairness metric for your deployment, click [help me choose](fairness-metrics#select-a-metric).

![](images/bf-mlops-10.png)

!!! note
    To calculate _True Favorable Rate & True Unfavorable Rate Parity_ and _Favorable Predictive & Unfavorable Predictive Value Parity_, the deployment must provide an [association ID](accuracy-settings#association-id).

## Define fairness monitoring notifications {: #define-fairness-monitoring-notifications }

Configure notifications to alert you when a production model is at risk of or fails to meet predefined fairness criteria. You can visualize fairness status on the [Fairness](mlops-fairness#investigate-bias) tab. Fairness monitoring uses a primary fairness metric and two thresholds&mdash;protected features considered to be "At Risk" and "Failing"&mdash;to monitor fairness. If not specified, DataRobot uses the default thresholds.

!!! note
     To access the settings in the **Definition & Notifications** section, configure and save the fairness settings. Only deployment _Owners_ can modify fairness monitoring settings; however, _Users_ can [configure the conditions under which notifications are sent to them](deploy-notifications). _Consumers_ cannot modify monitoring or notification settings.

To customize the rules used to calculate the fairness status for each deployment:

1. On the **Fairness Settings** page, in the **Definition** section, click **Set definition** and configure the threshold settings for monitoring fairness:

    ![](images/fairness-monitoring-definition.png)

    Threshold | Description
    ----------|--------
    At Risk   | Defines the number of protected features below the bias threshold that, when exceeded, classifies the deployment as "At Risk" and triggers notifications. The threshold for **At Risk** should be lower than the threshold for **Failing**. <br> **Default value**: `1`
    Failing   | Defines the number of protected features below the bias threshold that, when exceeded, classifies the deployment as "Failing" and triggers notifications. The threshold for **Failing** should be higher than the threshold for **At Risk**. <br> **Default value**: `2`

    !!! note
        Changes to thresholds affect the periods in which predictions are made across the entire history of a deployment. These updated thresholds are reflected in the performance monitoring visualizations on the [Fairness](mlops-fairness) tab. 
    
2. After updating the fairness monitoring settings, click **Save**.

## Schedule notification checks {: #schedule-notification-checks }

To schedule recurring checks to determine if fairness monitoring email notifications should be sent:

1. On the **Fairness Settings** page, in the **Notifications** section, enable **Send notifications**.

2. Configure the settings for fairness notifications. The following table lists the scheduling options. All times are displayed in UTC:

    | Frequency     | Description |
    |---------------|-------------|
    | Every hour    | Each hour on the selected minute past the hour. |
    | Every day     | Each day at the selected time. |
    | Every week    | Each selected day at the selected time. |
    | Every month   | Each month, on each selected day, at the selected time. The selected days in a month are provided as numbers (`1` to `31`) in a comma-separated list.
    | Every quarter | Each month of a quarter, on each selected day, at the selected time. The selected days in each month are provided as numbers (`1` to `31`) in a comma-separated list.
    | Every year    | Each selected month, on each selected day, at the selected time. The selected days in each month are provided as numbers (`1` to `31`) in a comma-separated list. |
    | **Use advanced scheduler** | :~~: |
    | Minute       | Each minute defined in a comma-separated list of numbers between `0` and `59`, or `*` for all. |
    | Hour         | Each hour defined in a comma-separated list of numbers between `0` and `23`, or `*` for all.   |
    | Day of month | Each day defined in a comma-separated list of numbers between `1` and `31`, or `*` for all.    |
    | Month        | Each month defined in a comma-separated list of numbers between `1` and `12`, or `*` for all.  |
    | Day of week  | Each weekday defined in a comma-separated list of numbers between `0` and `6`, or `*` for all. |

3. After updating the scheduling settings, click **Save**.

    {% include 'includes/notification-check-include.md' %}
