Data bias metrics for Vertex AI Stay organized with collections Save and categorize content based on your preferences.
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
This page describes evaluation metrics you can use to detectdata bias,which can appear in raw data and ground truth values even before you train themodel. For the examples and notation on this page, we use a hypothetical collegeapplication dataset that we describe in detail inIntroduction to modelevaluation for fairness.
For descriptions of metrics that are generated from post-training data, seeModel bias metrics.
Overview
In our example college application dataset, we have 200 applicants fromCalifornia in slice 1, and 100 Florida applicants in slice 2, labeled asfollows:
| Slice | Reject | Accept |
|---|---|---|
| California | 140 | 60 |
| Florida | 80 | 20 |
You can generally interpret the sign for most metrics as follows:
Positive value: indicates a potential bias favoring slice 1 over slice 2.
Zero value: indicates no bias in between slice 1 and slice 2.
Negative value: indicates a potential bias in favoring slice 2 over slice 1.
We make a note where this doesn't apply to a metric.
Difference in Population Size
Difference in Population Size measures whether there are more examples in slice 1versus slice 2, normalized by total population of the two slices:
(total population of slice 1 - total population of slice 2) /(sum of populations in slice 1 and 2)
In our example dataset:
(200 California applicants - 100 Florida applicants)/ 300 total applicants = 100/300 = 0.33.
The positive value of the Difference in Population Size indicates that there aredisproportionately more California applicants than Florida applicants. Thepositive value may or may not indicate bias by itself, but when a model istrained on this data, the model might learn to perform better for Californiaapplicants.
Difference in Positive Proportions in True Labels (DPPTL)
TheDifference in Positive Proportions in True Labels measures whether a datasethas disproportionately more positive ground truth labels for one slice over theother. This metric calculates the difference in Positive Proportions in TrueLabels between slice 1 and slice 2, where Positive Proportions in True Labelsfor a slice is (Labeled positive outcomes / Total population size). Thismetric is also known asLabel Imbalance:
Note: This metric is analogous to themodel bias metric ofDifference in Positive Proportions in Predicted Labels, which focuses onpredicted positive outcomes instead of labeled positive outcomes.(Labeled positive outcomes for slice 1/Total population size of slice 1) -(Labeled positive outcomes for slice 2/Total population size of slice 2)
In our example dataset:
(60 accepted California applicants/200 California applicants) - (20 acceptedFlorida applicants/100 Florida applicants) = 60/200 - 20/100 = 0.1.
The positive value of the DPPTL indicates that the dataset hasdisproportionately higher positive outcomes for California applicants comparedto Florida applicants. The positive value may or may not indicate bias byitself, but when a model is trained on this data, the model might learn topredict disproportionately more positive outcomes for California applicants.
What's next
Learn about themodel bias metrics supported by Vertex AI.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.