{"id":1496,"date":"2025-01-20T16:10:57","date_gmt":"2025-01-20T16:10:57","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=1496"},"modified":"2025-01-23T14:04:22","modified_gmt":"2025-01-23T14:04:22","slug":"1496","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/","title":{"rendered":"Algorithmic Fairness"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>This is the last in a series of excerpts from <em>Elements of Data Science<\/em>, now <a href=\"https:\/\/www.lulu.com\/shop\/allen-downey\/elements-of-data-science\/paperback\/product-9dyrwn.html\">available from Lulu.com<\/a> and online booksellers. <\/p>\n<\/blockquote>\n\n\n\n<p>This article is based on the Recidivism Case Study, which is about algorithmic fairness. The goal of the case study is to explain the statistical arguments presented in two articles from 2016:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u201c<a href=\"https:\/\/www.propublica.org\/article\/machine-bias-risk-assessments-in-criminal-sentencing\">Machine Bias<\/a>\u201d, by Julia Angwin, Jeff Larson, Surya Mattu and Lauren Kirchner, and published by <a href=\"https:\/\/www.propublica.org\">ProPublica<\/a>.<\/li>\n\n\n\n<li>A response by Sam Corbett-Davies, Emma Pierson, Avi Feller and Sharad Goel: \u201c<a href=\"https:\/\/www.washingtonpost.com\/news\/monkey-cage\/wp\/2016\/10\/17\/can-an-algorithm-be-racist-our-analysis-is-more-cautious-than-propublicas\/\">A computer program used for bail and sentencing decisions was labeled biased against blacks. It\u2019s actually not that clear.<\/a>\u201d, published in the Washington Post.<\/li>\n<\/ul>\n\n\n\n<p>Both are about COMPAS, a statistical tool used in the justice system to assign defendants a \u201crisk score\u201d that is intended to reflect the risk that they will commit another crime if released.<\/p>\n\n\n\n<p>The ProPublica article evaluates COMPAS as a binary classifier, and compares its error rates for black and white defendants. In response, the Washington Post article shows that COMPAS has the same predictive value black and white defendants. And they explain that the test cannot have the same predictive value and the same error rates at the same time.<\/p>\n\n\n\n<p><a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/RecidivismCaseStudy\/blob\/v1\/01_classification.ipynb\">In the first notebook<\/a> I replicated the analysis from the ProPublica article. <a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/RecidivismCaseStudy\/blob\/v1\/02_calibration.ipynb\">In the second notebook<\/a> I replicated the analysis from the WaPo article. In this article I use the same methods to evaluate the performance of COMPAS for male and female defendants. I find that COMPAS is unfair to women: at every level of predicted risk, women are less likely to be arrested for another crime.<\/p>\n\n\n\n<p>You can run this Jupyter notebook on <a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/RecidivismCaseStudy\/blob\/v1\/03_fairness.ipynb\">Colab<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Male and female defendants<\/h2>\n\n\n\n<p>The authors of the ProPublica article published a supplementary article, <a href=\"https:\/\/www.propublica.org\/article\/how-we-analyzed-the-compas-recidivism-algorithm\"><em>How We Analyzed the COMPAS Recidivism Algorithm<\/em><\/a>, which describes their analysis in more detail. In the supplementary article, they briefly mention results for male and female respondents:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The COMPAS system unevenly predicts recidivism between genders. According to Kaplan-Meier estimates, women rated high risk recidivated at a 47.5 percent rate during two years after they were scored. But men rated high risk recidivated at a much higher rate \u2013 61.2 percent \u2013 over the same time period. This means that a high-risk woman has a much lower risk of recidivating than a high-risk man, a fact that may be overlooked by law enforcement officials interpreting the score.<\/p>\n<\/blockquote>\n\n\n\n<p>We can replicate this result using the methods from the previous notebooks; we don\u2019t have to do Kaplan-Meier estimation.<\/p>\n\n\n\n<p>According to the binary gender classification in this dataset, about 81% of defendants are male.<\/p>\n\n\n\n<pre id=\"codecell2\" class=\"wp-block-preformatted\">male = cp[\"sex\"] == \"Male\"\nmale.mean()\n<\/pre>\n\n\n\n<pre id=\"codecell3\" class=\"wp-block-preformatted\">0.8066260049902967\n<\/pre>\n\n\n\n<pre id=\"codecell4\" class=\"wp-block-preformatted\">female = cp[\"sex\"] == \"Female\"\nfemale.mean()\n<\/pre>\n\n\n\n<pre id=\"codecell5\" class=\"wp-block-preformatted\">0.19337399500970334\n<\/pre>\n\n\n\n<p>Here are the confusion matrices for male and female defendants.<\/p>\n\n\n\n<pre id=\"codecell6\" class=\"wp-block-preformatted\">from rcs_utils import make_matrix\n\nmatrix_male = make_matrix(cp[male])\nmatrix_male\n<\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th>Pred Positive<\/th><th>Pred Negative<\/th><\/tr><tr><th>Actual<\/th><th><\/th><th><\/th><\/tr><\/thead><tbody><tr><th>Positive<\/th><td>1732<\/td><td>1021<\/td><\/tr><tr><th>Negative<\/th><td>994<\/td><td>2072<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre id=\"codecell7\" class=\"wp-block-preformatted\">matrix_female = make_matrix(cp[female])\nmatrix_female\n<\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th>Pred Positive<\/th><th>Pred Negative<\/th><\/tr><tr><th>Actual<\/th><th><\/th><th><\/th><\/tr><\/thead><tbody><tr><th>Positive<\/th><td>303<\/td><td>195<\/td><\/tr><tr><th>Negative<\/th><td>288<\/td><td>609<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>And here are the metrics:<\/p>\n\n\n\n<pre id=\"codecell8\" class=\"wp-block-preformatted\">from rcs_utils import compute_metrics\n\nmetrics_male = compute_metrics(matrix_male, \"Male defendants\")\nmetrics_male\n<\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th>Percent<\/th><\/tr><tr><th>Male defendants<\/th><th><\/th><\/tr><\/thead><tbody><tr><th>FPR<\/th><td>32.4<\/td><\/tr><tr><th>FNR<\/th><td>37.1<\/td><\/tr><tr><th>PPV<\/th><td>63.5<\/td><\/tr><tr><th>NPV<\/th><td>67.0<\/td><\/tr><tr><th>Prevalence<\/th><td>47.3<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre id=\"codecell9\" class=\"wp-block-preformatted\">metrics_female = compute_metrics(matrix_female, \"Female defendants\")\nmetrics_female\n<\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th>Percent<\/th><\/tr><tr><th>Female defendants<\/th><th><\/th><\/tr><\/thead><tbody><tr><th>FPR<\/th><td>32.1<\/td><\/tr><tr><th>FNR<\/th><td>39.2<\/td><\/tr><tr><th>PPV<\/th><td>51.3<\/td><\/tr><tr><th>NPV<\/th><td>75.7<\/td><\/tr><tr><th>Prevalence<\/th><td>35.7<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The fraction of defendants charged with another crime (prevalence) is substantially higher for male defendants (47% vs 36%).<\/p>\n\n\n\n<p>Nevertheless, the error rates for the two groups are about the same. As a result, the predictive values for the two groups are substantially different:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PPV: Women classified as high risk are less likely to be charged with another crime, compared to high-risk men (51% vs 64%).<\/li>\n\n\n\n<li>NPV: Women classified as low risk are more likely to \u201csurvive\u201d two years without a new charge, compared to low-risk men (76% vs 67%).<\/li>\n<\/ul>\n\n\n\n<p>The difference in predictive values implies that COMPAS is not calibrated for men and women. Here are the calibration curves for male and female defendants.<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png\" alt=\"_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png\"\/><\/figure>\n\n\n\n<p>For all risk scores, female defendants are substantially less likely to be charged with another crime. Or, reading the graph the other way, female defendants are given risk scores 1-2 points higher than male defendants with the same actual risk of recidivism.<\/p>\n\n\n\n<p>To the degree that COMPAS scores are used to decide which defendants are incarcerated, those decisions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Are unfair to women.<\/li>\n\n\n\n<li>Are less effective than they could be, if they incarcerate lower-risk women while allowing higher-risk men to go free.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What would it take?<\/h2>\n\n\n\n<p>Suppose we want to fix COMPAS so that predictive values are the same for male and female defendants. We could do that by using different thresholds for the two groups. In this section, we\u2019ll see what it would take to re-calibrate COMPAS; then we\u2019ll find out what effect that would have on error rates.<\/p>\n\n\n\n<p>From the previous notebook, <code>sweep_threshold<\/code> loops through possible thresholds, makes the confusion matrix for each threshold, and computes the accuracy metrics. Here are the resulting tables for all defendants, male defendants, and female defendants.<\/p>\n\n\n\n<pre id=\"codecell12\" class=\"wp-block-preformatted\">from rcs_utils import sweep_threshold<br><br>table_all = sweep_threshold(cp)<\/pre>\n\n\n\n<pre id=\"codecell13\" class=\"wp-block-preformatted\">table_male = sweep_threshold(cp[male])<\/pre>\n\n\n\n<pre id=\"codecell14\" class=\"wp-block-preformatted\">table_female = sweep_threshold(cp[female])\n<\/pre>\n\n\n\n<p>As we did in the previous notebook, we can find the threshold that would make predictive value the same for both groups.<\/p>\n\n\n\n<pre id=\"codecell15\" class=\"wp-block-preformatted\">from rcs_utils import predictive_value\n\nmatrix_all = make_matrix(cp)\nppv, npv = predictive_value(matrix_all)\n<\/pre>\n\n\n\n<pre id=\"codecell16\" class=\"wp-block-preformatted\">from rcs_utils import crossing\n\ncrossing(table_male[\"PPV\"], ppv)\n<\/pre>\n\n\n\n<pre id=\"codecell17\" class=\"wp-block-preformatted\">array(3.36782883)\n<\/pre>\n\n\n\n<pre id=\"codecell18\" class=\"wp-block-preformatted\">crossing(table_male[\"NPV\"], npv)\n<\/pre>\n\n\n\n<pre id=\"codecell19\" class=\"wp-block-preformatted\">array(3.40116329)\n<\/pre>\n\n\n\n<p>With a threshold near 3.4, male defendants would have the same predictive values as the general population. Now let\u2019s do the same computation for female defendants.<\/p>\n\n\n\n<pre id=\"codecell20\" class=\"wp-block-preformatted\">crossing(table_female[\"PPV\"], ppv)\n<\/pre>\n\n\n\n<pre id=\"codecell21\" class=\"wp-block-preformatted\">array(6.88124668)\n<\/pre>\n\n\n\n<pre id=\"codecell22\" class=\"wp-block-preformatted\">crossing(table_female[\"NPV\"], npv)\n<\/pre>\n\n\n\n<pre id=\"codecell23\" class=\"wp-block-preformatted\">array(6.82760429)\n<\/pre>\n\n\n\n<p>To get the same predictive values for men and women, we would need substantially different thresholds: about 6.8 compared to 3.4. At those levels, the false positive rates would be very different:<\/p>\n\n\n\n<pre id=\"codecell24\" class=\"wp-block-preformatted\">from rcs_utils import interpolate\n\ninterpolate(table_male[\"FPR\"], 3.4)\n<\/pre>\n\n\n\n<pre id=\"codecell25\" class=\"wp-block-preformatted\">array(39.12)\n<\/pre>\n\n\n\n<pre id=\"codecell26\" class=\"wp-block-preformatted\">interpolate(table_female[\"FPR\"], 6.8)\n<\/pre>\n\n\n\n<pre id=\"codecell27\" class=\"wp-block-preformatted\">array(9.14)\n<\/pre>\n\n\n\n<p>And so would the false negative rates.<\/p>\n\n\n\n<pre id=\"codecell28\" class=\"wp-block-preformatted\">interpolate(table_male[\"FNR\"], 3.4)\n<\/pre>\n\n\n\n<pre id=\"codecell29\" class=\"wp-block-preformatted\">array(30.98)\n<\/pre>\n\n\n\n<pre id=\"codecell30\" class=\"wp-block-preformatted\">interpolate(table_female[\"FNR\"], 6.8)\n<\/pre>\n\n\n\n<pre id=\"codecell31\" class=\"wp-block-preformatted\">array(74.18)\n<\/pre>\n\n\n\n<p>If the test is calibrated in terms of predictive value, it is uncalibrated in terms of error rates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ROC<\/h2>\n\n\n\n<p>In the previous notebook I defined the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Receiver_operating_characteristic\">receiver operating characteristic (ROC) curve<\/a>. The following figure shows ROC curves for male and female defendants:<\/p>\n\n\n\n<pre id=\"codecell32\" class=\"wp-block-preformatted\">from rcs_utils import plot_roc\n\nplot_roc(table_male)\nplot_roc(table_female)\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/6c3b663c6aee1331f0bd08cae9c973892e52b264950db4baa0d3db68ea2dc790.png\" alt=\"_images\/6c3b663c6aee1331f0bd08cae9c973892e52b264950db4baa0d3db68ea2dc790.png\"\/><\/figure>\n\n\n\n<p>The ROC curves are nearly identical, which implies that it is possible to calibrate COMPAS equally for male and female defendants.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>With respect to sex, COMPAS is fair by the criteria posed by the ProPublica article: it has the same error rates for groups with different prevalence. But it is unfair by the criteria of the WaPo article, which argues:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>A risk score of seven for black defendants should mean the same thing as a score of seven for white defendants. Imagine if that were not so, and we systematically assigned whites higher risk scores than equally risky black defendants with the goal of mitigating ProPublica\u2019s criticism. We would consider that a violation of the fundamental tenet of equal treatment.<\/p>\n<\/blockquote>\n\n\n\n<p>With respect to male and female defendants, COMPAS violates this tenet.<\/p>\n\n\n\n<p>So who\u2019s right? We have two competing definitions of fairness, and it is mathematically impossible to satisfy them both. Is it better to have equal error rates for all groups, as COMPAS does for men and women? Or is it better to be calibrated, which implies equal predictive values? Or, since we can\u2019t have both, should the test be \u201ctempered\u201d, allowing both error rates and predictive values to depend on prevalence?<\/p>\n\n\n\n<p><a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/RecidivismCaseStudy\/blob\/v1\/04_matrix.ipynb\">In the next notebook<\/a> I explore these trade-offs in more detail. And I summarized these results in Chapter 9 of <a href=\"https:\/\/greenteapress.com\/wp\/probably-overthinking-it\/\"><em>Probably Overthinking It<\/em><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the last in a series of excerpts from Elements of Data Science, now available from Lulu.com and online booksellers. This article is based on the Recidivism Case Study, which is about algorithmic fairness. The goal of the case study is to explain the statistical arguments presented in two articles from 2016: Both are about COMPAS, a statistical tool used in the justice system to assign defendants a \u201crisk score\u201d that is intended to reflect the risk that they&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1496","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Algorithmic Fairness - Probably Overthinking It<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Algorithmic Fairness - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"This is the last in a series of excerpts from Elements of Data Science, now available from Lulu.com and online booksellers. This article is based on the Recidivism Case Study, which is about algorithmic fairness. The goal of the case study is to explain the statistical arguments presented in two articles from 2016: Both are about COMPAS, a statistical tool used in the justice system to assign defendants a \u201crisk score\u201d that is intended to reflect the risk that they... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-20T16:10:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-23T14:04:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png\" \/>\n<meta name=\"author\" content=\"AllenDowney\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:site\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"AllenDowney\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\"},\"author\":{\"name\":\"AllenDowney\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"Algorithmic Fairness\",\"datePublished\":\"2025-01-20T16:10:57+00:00\",\"dateModified\":\"2025-01-23T14:04:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\"},\"wordCount\":1106,\"publisher\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\",\"url\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\",\"name\":\"Algorithmic Fairness - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png\",\"datePublished\":\"2025-01-20T16:10:57+00:00\",\"dateModified\":\"2025-01-23T14:04:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage\",\"url\":\"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png\",\"contentUrl\":\"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.allendowney.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Algorithmic Fairness\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#website\",\"url\":\"https:\/\/www.allendowney.com\/blog\/\",\"name\":\"Probably Overthinking It\",\"description\":\"Data science, Bayesian Statistics, and other ideas\",\"publisher\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.allendowney.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#organization\",\"name\":\"Probably Overthinking It\",\"url\":\"https:\/\/www.allendowney.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png\",\"contentUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png\",\"width\":714,\"height\":784,\"caption\":\"Probably Overthinking It\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/AllenDowney\",\"https:\/\/www.linkedin.com\/in\/allendowney\/\",\"https:\/\/bsky.app\/profile\/allendowney.bsky.social\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207\",\"name\":\"AllenDowney\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g\",\"caption\":\"AllenDowney\"},\"url\":\"https:\/\/www.allendowney.com\/blog\/author\/allendowney_6dbrc4\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Algorithmic Fairness - Probably Overthinking It","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/","og_locale":"en_US","og_type":"article","og_title":"Algorithmic Fairness - Probably Overthinking It","og_description":"This is the last in a series of excerpts from Elements of Data Science, now available from Lulu.com and online booksellers. This article is based on the Recidivism Case Study, which is about algorithmic fairness. The goal of the case study is to explain the statistical arguments presented in two articles from 2016: Both are about COMPAS, a statistical tool used in the justice system to assign defendants a \u201crisk score\u201d that is intended to reflect the risk that they... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/","og_site_name":"Probably Overthinking It","article_published_time":"2025-01-20T16:10:57+00:00","article_modified_time":"2025-01-23T14:04:22+00:00","og_image":[{"url":"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png","type":"","width":"","height":""}],"author":"AllenDowney","twitter_card":"summary_large_image","twitter_creator":"@AllenDowney","twitter_site":"@AllenDowney","twitter_misc":{"Written by":"AllenDowney","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/"},"author":{"name":"AllenDowney","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"Algorithmic Fairness","datePublished":"2025-01-20T16:10:57+00:00","dateModified":"2025-01-23T14:04:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/"},"wordCount":1106,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage"},"thumbnailUrl":"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/","url":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/","name":"Algorithmic Fairness - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage"},"thumbnailUrl":"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png","datePublished":"2025-01-20T16:10:57+00:00","dateModified":"2025-01-23T14:04:22+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#primaryimage","url":"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png","contentUrl":"https:\/\/allendowney.github.io\/RecidivismCaseStudy\/_images\/0c00fcec5fcb5d27076980d67c956f77bd0f84a3c39072a7a423b9f462b40780.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2025\/01\/20\/1496\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Algorithmic Fairness"}]},{"@type":"WebSite","@id":"https:\/\/www.allendowney.com\/blog\/#website","url":"https:\/\/www.allendowney.com\/blog\/","name":"Probably Overthinking It","description":"Data science, Bayesian Statistics, and other ideas","publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.allendowney.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.allendowney.com\/blog\/#organization","name":"Probably Overthinking It","url":"https:\/\/www.allendowney.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","contentUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","width":714,"height":784,"caption":"Probably Overthinking It"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/AllenDowney","https:\/\/www.linkedin.com\/in\/allendowney\/","https:\/\/bsky.app\/profile\/allendowney.bsky.social"]},{"@type":"Person","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207","name":"AllenDowney","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g","caption":"AllenDowney"},"url":"https:\/\/www.allendowney.com\/blog\/author\/allendowney_6dbrc4\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1334,"url":"https:\/\/www.allendowney.com\/blog\/2024\/07\/17\/elements-of-data-science\/","url_meta":{"origin":1496,"position":0},"title":"Elements of Data Science","author":"AllenDowney","date":"July 17, 2024","format":false,"excerpt":"I'm excited to announce the launch of my newest book, Elements of Data Science. As the subtitle suggests, it is about \"Getting started with Data Science and Python\". Order now from Lulu.com and get 20% off! I am publishing this book myself, which has one big advantage: I can print\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/07\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/07\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/07\/image.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1766,"url":"https:\/\/www.allendowney.com\/blog\/2026\/04\/03\/trust-and-well-being\/","url_meta":{"origin":1496,"position":1},"title":"Trust and Well-Being","author":"AllenDowney","date":"April 3, 2026","format":false,"excerpt":"In a previous article, I claimed that Young adults are not very happy. Now the World Happiness Report 2026 has confirmed that young people in North America and Western Europe are less happy than they were fifteen years ago, and less happy than previous generations. In this article, we\u2019ll look\u2026","rel":"","context":"In \"age period cohort analysis\"","block_context":{"text":"age period cohort analysis","link":"https:\/\/www.allendowney.com\/blog\/tag\/age-period-cohort-analysis\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2026\/04\/cohort_standardized_-24a4cd718ef72385d57fbc3eb0dbc47d.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2026\/04\/cohort_standardized_-24a4cd718ef72385d57fbc3eb0dbc47d.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2026\/04\/cohort_standardized_-24a4cd718ef72385d57fbc3eb0dbc47d.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2026\/04\/cohort_standardized_-24a4cd718ef72385d57fbc3eb0dbc47d.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2026\/04\/cohort_standardized_-24a4cd718ef72385d57fbc3eb0dbc47d.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":956,"url":"https:\/\/www.allendowney.com\/blog\/2023\/06\/10\/abstracts-and-keywords\/","url_meta":{"origin":1496,"position":2},"title":"Abstracts and keywords","author":"AllenDowney","date":"June 10, 2023","format":false,"excerpt":"As Probably Overthinking It approaches the finish line, there are just a few more tasks: I am working on the index and -- as I have recently learned -- I also have to write a 200-word abstract, a list of keywords for each chapter, and a 250-word abstract for the\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":259,"url":"https:\/\/www.allendowney.com\/blog\/2019\/08\/01\/left-right-part-3\/","url_meta":{"origin":1496,"position":3},"title":"Left, right, part 3","author":"AllenDowney","date":"August 1, 2019","format":false,"excerpt":"In the first article in this series, I looked at data from the General Social Survey (GSS) to see how political alignment in the U.S. has changed, on the axis from conservative to liberal, over the last 50 years. In the second article, I suggested that self-reported political alignment could\u2026","rel":"","context":"In \"general social survey\"","block_context":{"text":"general social survey","link":"https:\/\/www.allendowney.com\/blog\/tag\/general-social-survey\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/08\/image-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":874,"url":"https:\/\/www.allendowney.com\/blog\/2023\/02\/17\/driving-under-the-influence\/","url_meta":{"origin":1496,"position":4},"title":"Driving Under the Influence","author":"AllenDowney","date":"February 17, 2023","format":false,"excerpt":"This recent article in the Washington Post reports that \"a police department in Maryland is training officers to spot the signs of driving high by watching people toke up in a tent\". The story features Lt. John O\u2019Brien, who is described as a \"trained drug recognition expert\". It also quotes\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":267,"url":"https:\/\/www.allendowney.com\/blog\/2019\/08\/06\/left-right-part-4\/","url_meta":{"origin":1496,"position":5},"title":"Left, right, part 4","author":"AllenDowney","date":"August 6, 2019","format":false,"excerpt":"In the first article in this series, I looked at data from the General Social Survey (GSS) to see how political alignment in the U.S. has changed, on the axis from conservative to liberal, over the last 50 years. In the second article, I suggested that self-reported political alignment could\u2026","rel":"","context":"In \"data science\"","block_context":{"text":"data science","link":"https:\/\/www.allendowney.com\/blog\/tag\/data-science\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/08\/image-5.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/1496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/comments?post=1496"}],"version-history":[{"count":3,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/1496\/revisions"}],"predecessor-version":[{"id":1499,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/1496\/revisions\/1499"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=1496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=1496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=1496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}