{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## [Machine Bias](https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing): ProPublica's analysis of the COMPAS tool" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This workbook restates the initial data analysis tasks, per ProPublica's [methodology description](https://www.propublica.org/article/how-we-analyzed-the-compas-recidivism-algorithm) and [code](https://github.com/propublica/compas-analysis/blob/master/Compas%20Analysis.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We will do our analysis with Pandas." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "import matplotlib\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Acquiring the dataset, and understanding the data collection methodology.\n", "\n", "Create a folder called \"data\" under the current folder, and download the COMPAS scores dataset. The dataset is archived and is not expected to change. Therefore, you can comment out this block if you already downloaded the data." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", "100 2486k 100 2486k 0 0 2806k 0 --:--:-- --:--:-- --:--:-- 2803k\n" ] } ], "source": [ "# Creates a folder \"data\" under the current folder\n", "!mkdir -p data\n", "# Removes any prior file if it exists\n", "!rm -f data/compas-scores-two-years.csv*\n", "# Fetches the most recent dataset and stores it under the folder data\n", "!curl 'https://raw.githubusercontent.com/propublica/compas-analysis/master/compas-scores-two-years.csv' -o data/compas-scores-two-years.csv\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Inspect the file. Read the description of the [data collection methodology](https://www.propublica.org/article/how-we-analyzed-the-compas-recidivism-algorithm). Salient points are highlighted below, with my annotations in **bold font**. See full description from ProPublica for additional details. \n", "\n", ">**Goal**: We looked at more than 10,000 criminal defendants in Broward County, Florida, and compared their predicted recidivism rates with the rate that actually occurred over a two-year period.\n", "\n", ">**COMPAS tool input (data subjects)**: When most defendants are booked in jail, they respond to a COMPAS questionnaire. Their answers are fed into the COMPAS software to generate several scores including predictions of *Risk of Recidivism* and *Risk of Violent Recidivism*\n", "\n", ">**How COMPAS input was acquired by ProPublica**: Through a public records request, ProPublica obtained two years worth of COMPAS scores from the Broward County Sheriff’s Office in Florida. We received data for all 18,610 people who were scored in 2013 and 2014.\n", "\n", ">**COMPAS tool output**: Each pretrial defendant received at least three COMPAS scores: “Risk of Recidivism,” “Risk of Violence” and “Risk of Failure to Appear. ... COMPAS scores for each defendant ranged from 1 to 10, with ten being the highest risk. Scores 1 to 4 were labeled by COMPAS as “Low”; 5 to 7 were labeled “Medium”; and 8 to 10 were labeled “High.”\n", "\n", ">**Data integration (record linkage) to matching COMPAS input and output with an individual's criminal history** Starting with the database of COMPAS scores, we built a profile of each person’s criminal history, both before and after they were scored. We collected public criminal records from the Broward County Clerk’s Office website through April 1, 2016. On average, defendants in our dataset were not incarcerated for 622.87 days (sd: 329.19).\n", "\n", ">**Data integration (record linkage) details**: We matched the criminal records to the COMPAS records using a person’s first and last names and date of birth. This is the same technique used in the Broward County COMPAS validation study conducted by researchers at Florida State University in 2010. We downloaded around 80,000 criminal records from the Broward County Clerk’s Office website.\n", "\n", ">**What is recidivism?**: Northpointe defined recidivism as “a finger-printable arrest involving a charge and a filing for any uniform crime reporting (UCR) code.” We interpreted that to mean a criminal offense that resulted in a jail booking and took place after the crime for which the person was COMPAS scored. ... **For most of our analysis, we defined recidivism as a new arrest within two years. **" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>id</th>\n", " <th>name</th>\n", " <th>first</th>\n", " <th>last</th>\n", " <th>compas_screening_date</th>\n", " <th>sex</th>\n", " <th>dob</th>\n", " <th>age</th>\n", " <th>age_cat</th>\n", " <th>race</th>\n", " <th>...</th>\n", " <th>v_decile_score</th>\n", " <th>v_score_text</th>\n", " <th>v_screening_date</th>\n", " <th>in_custody</th>\n", " <th>out_custody</th>\n", " <th>priors_count.1</th>\n", " <th>start</th>\n", " <th>end</th>\n", " <th>event</th>\n", " <th>two_year_recid</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>1</td>\n", " <td>miguel hernandez</td>\n", " <td>miguel</td>\n", " <td>hernandez</td>\n", " <td>2013-08-14</td>\n", " <td>Male</td>\n", " <td>1947-04-18</td>\n", " <td>69</td>\n", " <td>Greater than 45</td>\n", " <td>Other</td>\n", " <td>...</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>2013-08-14</td>\n", " <td>2014-07-07</td>\n", " <td>2014-07-14</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>327</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>3</td>\n", " <td>kevon dixon</td>\n", " <td>kevon</td>\n", " <td>dixon</td>\n", " <td>2013-01-27</td>\n", " <td>Male</td>\n", " <td>1982-01-22</td>\n", " <td>34</td>\n", " <td>25 - 45</td>\n", " <td>African-American</td>\n", " <td>...</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>2013-01-27</td>\n", " <td>2013-01-26</td>\n", " <td>2013-02-05</td>\n", " <td>0</td>\n", " <td>9</td>\n", " <td>159</td>\n", " <td>1</td>\n", " <td>1</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>4</td>\n", " <td>ed philo</td>\n", " <td>ed</td>\n", " <td>philo</td>\n", " <td>2013-04-14</td>\n", " <td>Male</td>\n", " <td>1991-05-14</td>\n", " <td>24</td>\n", " <td>Less than 25</td>\n", " <td>African-American</td>\n", " <td>...</td>\n", " <td>3</td>\n", " <td>Low</td>\n", " <td>2013-04-14</td>\n", " <td>2013-06-16</td>\n", " <td>2013-06-16</td>\n", " <td>4</td>\n", " <td>0</td>\n", " <td>63</td>\n", " <td>0</td>\n", " <td>1</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>5</td>\n", " <td>marcu brown</td>\n", " <td>marcu</td>\n", " <td>brown</td>\n", " <td>2013-01-13</td>\n", " <td>Male</td>\n", " <td>1993-01-21</td>\n", " <td>23</td>\n", " <td>Less than 25</td>\n", " <td>African-American</td>\n", " <td>...</td>\n", " <td>6</td>\n", " <td>Medium</td>\n", " <td>2013-01-13</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1174</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>6</td>\n", " <td>bouthy pierrelouis</td>\n", " <td>bouthy</td>\n", " <td>pierrelouis</td>\n", " <td>2013-03-26</td>\n", " <td>Male</td>\n", " <td>1973-01-22</td>\n", " <td>43</td>\n", " <td>25 - 45</td>\n", " <td>Other</td>\n", " <td>...</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>2013-03-26</td>\n", " <td>NaN</td>\n", " <td>NaN</td>\n", " <td>2</td>\n", " <td>0</td>\n", " <td>1102</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "<p>5 rows × 53 columns</p>\n", "</div>" ], "text/plain": [ " id name first last compas_screening_date sex \\\n", "0 1 miguel hernandez miguel hernandez 2013-08-14 Male \n", "1 3 kevon dixon kevon dixon 2013-01-27 Male \n", "2 4 ed philo ed philo 2013-04-14 Male \n", "3 5 marcu brown marcu brown 2013-01-13 Male \n", "4 6 bouthy pierrelouis bouthy pierrelouis 2013-03-26 Male \n", "\n", " dob age age_cat race ... \\\n", "0 1947-04-18 69 Greater than 45 Other ... \n", "1 1982-01-22 34 25 - 45 African-American ... \n", "2 1991-05-14 24 Less than 25 African-American ... \n", "3 1993-01-21 23 Less than 25 African-American ... \n", "4 1973-01-22 43 25 - 45 Other ... \n", "\n", " v_decile_score v_score_text v_screening_date in_custody out_custody \\\n", "0 1 Low 2013-08-14 2014-07-07 2014-07-14 \n", "1 1 Low 2013-01-27 2013-01-26 2013-02-05 \n", "2 3 Low 2013-04-14 2013-06-16 2013-06-16 \n", "3 6 Medium 2013-01-13 NaN NaN \n", "4 1 Low 2013-03-26 NaN NaN \n", "\n", " priors_count.1 start end event two_year_recid \n", "0 0 0 327 0 0 \n", "1 0 9 159 1 1 \n", "2 4 0 63 0 1 \n", "3 1 0 1174 0 0 \n", "4 2 0 1102 0 0 \n", "\n", "[5 rows x 53 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "csv_file_vr = 'data/compas-scores-two-years.csv'\n", "df = pd.read_csv(csv_file_vr)\n", "df.head()\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>id</th>\n", " <th>sex</th>\n", " <th>age</th>\n", " <th>race</th>\n", " <th>decile_score</th>\n", " <th>score_text</th>\n", " <th>v_decile_score</th>\n", " <th>v_score_text</th>\n", " <th>two_year_recid</th>\n", " <th>priors_count</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>1</td>\n", " <td>Male</td>\n", " <td>69</td>\n", " <td>Other</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>3</td>\n", " <td>Male</td>\n", " <td>34</td>\n", " <td>African-American</td>\n", " <td>3</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>4</td>\n", " <td>Male</td>\n", " <td>24</td>\n", " <td>African-American</td>\n", " <td>4</td>\n", " <td>Low</td>\n", " <td>3</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>4</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>5</td>\n", " <td>Male</td>\n", " <td>23</td>\n", " <td>African-American</td>\n", " <td>8</td>\n", " <td>High</td>\n", " <td>6</td>\n", " <td>Medium</td>\n", " <td>0</td>\n", " <td>1</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>6</td>\n", " <td>Male</td>\n", " <td>43</td>\n", " <td>Other</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>0</td>\n", " <td>2</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " id sex age race decile_score score_text v_decile_score \\\n", "0 1 Male 69 Other 1 Low 1 \n", "1 3 Male 34 African-American 3 Low 1 \n", "2 4 Male 24 African-American 4 Low 3 \n", "3 5 Male 23 African-American 8 High 6 \n", "4 6 Male 43 Other 1 Low 1 \n", "\n", " v_score_text two_year_recid priors_count \n", "0 Low 0 0 \n", "1 Low 1 0 \n", "2 Low 1 4 \n", "3 Medium 0 1 \n", "4 Low 0 2 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# projection: keep a subset of the columns in the original dataset\n", "df1 = df[['id','sex','age', 'race','decile_score','score_text','v_decile_score','v_score_text', \n", " 'two_year_recid','priors_count']]\n", "\n", "df1.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data profiling\n", "\n", "Understand the statistical properties of the dataset. \n", "\n", "Here, we inspect the basic properties of the dataset: break-down by age, gender and race." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a20130da0>" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAD8CAYAAACcjGjIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEfNJREFUeJzt3X+s3XV9x/Hne0UdtM4WKze1ZSsmjZN5B8JNrXMxt7IBBWPdMhIIkeJw3R/VwXITU7dsTI0ZS4Y6EkZWpRM3R8f8MRpoxKbjxrlMhCrQYiV02kBp16pgXcEYr3vvj/O58+R+7u29Peeec76lz0dycs73cz7n+32f7znnvu738/2e74nMRJKkdr8w6AIkSc1jOEiSKoaDJKliOEiSKoaDJKliOEiSKoaDJKliOEiSKoaDJKlyxqALOJGlS5fmypUrezLvF154gYULF/Zk3t1qcm3Q7PqsrTPW1pmm1rZ79+7vZ+ZruppJZjb2cvHFF2evPPjggz2bd7eaXFtms+uzts5YW2eaWhvwSHb599dhJUlSxXCQJFUMB0lSxXCQJFUMB0lSxXCQJFUMB0lSxXCQJFUMB0lSpdGnzzhVrdx8f1ePHxue4PoO53Hgliu7WrYkgVsOkqRpGA6SpIrhIEmqGA6SpIrhIEmqGA6SpIrhIEmqGA6SpIrhIEmqGA6SpIrhIEmqGA6SpIrhIEmqGA6SpMqs4RAR50bEgxGxLyKeiIgbS/vZEbEzIp4q10tKe0TEbRGxPyIej4iL2ua1ofR/KiI29O5pSZK6MZcthwlgLDPfAKwBNkXE+cBmYFdmrgJ2lWmAdcCqctkI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ltn+nFVaPAZcMcr3RCqbDwE9pbRncMFMttIaVbqe1L3MPraPBZl2G35CWJFVOi2ElSdLJMRwkSRXDQZJUMRwkSRXDQZJUMRwkSRXDQZJUMRwkSZX/A3ywvkDirAUFAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df1[\"age\"].hist()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x11da1a630>" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAFJCAYAAACSIPrDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xu8nFV97/HPl3BT5CobDoZLqI0iqAQagWovApabF7BCAW8pxaa+DlasHivaVm7S6rHIOViLhYLFlhaxhZKjaTEiXqjlEiASwqWkYCWCEAW5Q0n4nj+etclkZyd772T2fmZmfd+v17z2zJpn9vwespnvPOtZz1qyTURE1GejtguIiIh2JAAiIiqVAIiIqFQCICKiUgmAiIhKJQAiIiqVAIiIqFQCICKiUgmAiIhKJQAiIiq1cdsFrMv222/vGTNmtF1GRERfuemmm35qe2is7Xo6AGbMmMHChQvbLiMioq9I+q/xbJcuoIiISiUAIiIqlQCIiKhUAiAiolIJgIiISiUAIiIqlQCIiKhUAiAiolI9fSHY+ppxyten9P1++Ok3T+n7RUR0Q44AIiIqlQCIiKhUAiAiolIJgIiISiUAIiIqlQCIiKjUmAEgaXNJN0j6gaQlkk4v7X8j6V5Ji8ptVmmXpHMlLZV0q6R9O37XHEl3l9ucydutiIgYy3iuA3gWOMj2E5I2Aa6V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e2lpu8f2L7RbWUTE1OmrtOqidwA/Aa6RdIGkg1n9RHBExMCr8ghgmKQtgKNouoIOojljf4Xtb7RaWETEFKg6ADqVoVvHAMf22pzdERGTIQEQEVGpWs8BRERULwEQEVGpBEBERKUSABERlUoARERU6v8DqHNhrqifUMgAAAAASUVORK5CYII=\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df1[\"race\"].value_counts().plot(kind='bar')" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a20130d68>" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEWCAYAAABv+EDhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEehJREFUeJzt3X+s3Xddx/Hni1ZgotDB7palrXbERh0qg1y3KYlRpt0PlO4PZ4YG6mxsTCZoYqLDmBQ2iKDGKUQWGzbsCDImqCuIjFrAHzEbu4OJbGNpnbheO+nVdkNdGG68/eN8Cmfbbe+52935jvt5PpLmfL/v7+ec8/5uN/d1v5/v93xPqgpJUn+eNXQDkqRhGACS1CkDQJI6ZQBIUqcMAEnqlAEgSZ0yACSpUwaAJHXKAJCkTq0duoETOeWUU2rTpk1DtyFJ31Ruv/32/6yqmaXGTRQASdYB7wa+DyjgF4B7gA8Am4AvAj9TVUeTBPhD4CLgIeDnq+oz7XW2Ab/VXvYtVbX7RO+7adMm5ubmJmlRktQk+bdJxk06BfSHwMeq6nuAlwJ3A1cA+6pqM7CvrQNcCGxu/3YA17SGXgjsBM4BzgZ2Jjl5wveXJK2wJQMgyfOBHwGuBaiqr1bVA8B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U5gc1X9TZJvBdZU1X8P3VcvnCaQNIgkvwh8EPjjVlrP6MNhmhIDQNJQLgdeAXwZoKr2451qp8oAkDSUh8cvAU2ylhN8WbxWngEgaSh/m+Q3gZOS/ATwZ4zuC6Qp8SSwpEG0LyraDmxh9PmUm4F3l7+UpsYAkDRVSb6jqu4bug85BSRp+r5+pU+SDw3ZSO8MAEnTNv7dFC8erAsZAJKmro6zrCnzHICkqUryKKMbFQY4CXjo2Ca8UeFUGQCS1CmngCSpUwaAJHXKAJCkThkAktSp/wfhJL5NKL0rpQAAAABJRU5ErkJggg==\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df1[\"sex\"].value_counts().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data cleaning\n", "\n", "\"However not all of the rows are useable for the first round of analysis.\n", "\n", "There are a number of reasons remove rows because of missing data:\n", "\n", "If the charge date of a defendants Compas scored crime was not within 30 days from when the person was arrested, we assume that because of data quality reasons, that we do not have the right offense.\n", "We coded the recidivist flag -- is_recid -- to be -1 if we could not find a compas case at all.\n", "In a similar vein, ordinary traffic offenses -- those with a c_charge_degree of 'O' -- will not result in Jail time are removed (only two of them).\n", "We filtered the underlying data from Broward county to include only those rows representing people who had either recidivated in two years, or had at least two years outside of a correctional facility.\"" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>id</th>\n", " <th>sex</th>\n", " <th>age</th>\n", " <th>race</th>\n", " <th>decile_score</th>\n", " <th>score_text</th>\n", " <th>v_decile_score</th>\n", " <th>v_score_text</th>\n", " <th>two_year_recid</th>\n", " <th>priors_count</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>1</td>\n", " <td>Male</td>\n", " <td>69</td>\n", " <td>Other</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>3</td>\n", " <td>Male</td>\n", " <td>34</td>\n", " <td>African-American</td>\n", " <td>3</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>4</td>\n", " <td>Male</td>\n", " <td>24</td>\n", " <td>African-American</td>\n", " <td>4</td>\n", " <td>Low</td>\n", " <td>3</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>4</td>\n", " </tr>\n", " <tr>\n", " <th>5</th>\n", " <td>7</td>\n", " <td>Male</td>\n", " <td>44</td>\n", " <td>Other</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>6</th>\n", " <td>8</td>\n", " <td>Male</td>\n", " <td>41</td>\n", " <td>Caucasian</td>\n", " <td>6</td>\n", " <td>Medium</td>\n", " <td>2</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>14</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " id sex age race decile_score score_text v_decile_score \\\n", "0 1 Male 69 Other 1 Low 1 \n", "1 3 Male 34 African-American 3 Low 1 \n", "2 4 Male 24 African-American 4 Low 3 \n", "5 7 Male 44 Other 1 Low 1 \n", "6 8 Male 41 Caucasian 6 Medium 2 \n", "\n", " v_score_text two_year_recid priors_count \n", "0 Low 0 0 \n", "1 Low 1 0 \n", "2 Low 1 4 \n", "5 Low 0 0 \n", "6 Low 1 14 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# clean the data per ProPublica's methodology\n", "df2 = df1[(df.c_charge_degree != 'O') & (df.score_text != 'N/A') & (df.is_recid != -1)\n", " & (df.days_b_screening_arrest <= 30) & (df.days_b_screening_arrest >= -30)]\n", "\n", "df2.head()\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Original 7214\n", "Projected 7214\n", "Cleaned 6172\n" ] }, { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>id</th>\n", " <th>sex</th>\n", " <th>age</th>\n", " <th>race</th>\n", " <th>decile_score</th>\n", " <th>score_text</th>\n", " <th>v_decile_score</th>\n", " <th>v_score_text</th>\n", " <th>two_year_recid</th>\n", " <th>priors_count</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>1</td>\n", " <td>Male</td>\n", " <td>69</td>\n", " <td>Other</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>3</td>\n", " <td>Male</td>\n", " <td>34</td>\n", " <td>African-American</td>\n", " <td>3</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>4</td>\n", " <td>Male</td>\n", " <td>24</td>\n", " <td>African-American</td>\n", " <td>4</td>\n", " <td>Low</td>\n", " <td>3</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>4</td>\n", " </tr>\n", " <tr>\n", " <th>5</th>\n", " <td>7</td>\n", " <td>Male</td>\n", " <td>44</td>\n", " <td>Other</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>Low</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>6</th>\n", " <td>8</td>\n", " <td>Male</td>\n", " <td>41</td>\n", " <td>Caucasian</td>\n", " <td>6</td>\n", " <td>Medium</td>\n", " <td>2</td>\n", " <td>Low</td>\n", " <td>1</td>\n", " <td>14</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " id sex age race decile_score score_text v_decile_score \\\n", "0 1 Male 69 Other 1 Low 1 \n", "1 3 Male 34 African-American 3 Low 1 \n", "2 4 Male 24 African-American 4 Low 3 \n", "5 7 Male 44 Other 1 Low 1 \n", "6 8 Male 41 Caucasian 6 Medium 2 \n", "\n", " v_score_text two_year_recid priors_count \n", "0 Low 0 0 \n", "1 Low 1 0 \n", "2 Low 1 4 \n", "5 Low 0 0 \n", "6 Low 1 14 " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print('Original ', len(df))\n", "print('Projected ', len(df1))\n", "print ('Cleaned ', len(df2))\n", "df2.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data profiling, after data cleaning \n", "\n", "Look at basic properties of the dataset: break-down by age, gender and race. Compare histograms before and after data cleaning.\n", "\n", "Observe that we are going through the lifecycle **iteratively**: profile, clean, profile again. " ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a2069f6d8>" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAD8CAYAAACcjGjIAAAABHNCSVQICAgIfAhkiAA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Xb9ZDM17T1wHfA/6+DMd9KiIWNqS2dlcDd5fbA68tM58F/hp4GjgMHAN204z3217gbRHx6og4C7iC1hd6B77e2sxUS0enLTqtwiEiFgGfB27KzB8Nup5JmfmzbG3mr6C12fqG6br1tyqIiHcARzNzd3vzNF0HdcjbWzPzIlqbzZsi4m0DqmOqM4CLgDsy803ACwxueGtaZdz+ncC/DLqWSWWMfD1wHvBaYCGt13aqvr/fMnMfreGtncCXgMdoDVefCjr6zJ424RARL6MVDJ/NzC+U5iMRsazcv4zWf+4Dk5k/BMZp7RdZHBGT30OpTjPSJ28F3hkRB4BttIaWPtGQ2sjMQ+X6KK1x89U04zU9CBzMzIfK9OdohUUTapu0DvhGZh4p002o7beA72bm9zLzp8AXgN+gOe+3OzPzosx8G/Ac8BTNWG+TZqpl1tMWTee0CIeICOBOYF9mfqztru3AhnJ7A619Ef2u7TURsbjcPpPWB2Qf8CDwe4OsLTM/mJkrMnMlrSGIf8vMa5tQW0QsjIhXTt6mNX6+lwa8ppn538AzEfH60nQJrdPSD7y2Ntfw8yElaEZtTwNrIuKs8pmdXG8Df78BRMQ55fqXgd+ltf6asN4mzVTLduC6ctTSGuDY5PDTCfV7x84gLsBv0tqMehx4tFyuoDV+vovWfwC7gLMHUNuvA98ste0F/ry0vw74OrCf1qb/Kwa8DkeB+5pSW6nhsXJ5gtYZKGnCa1rquBB4pLyu/wosaVBtZwE/AF7V1taU2j4EfLt8Fv4BeEUT3m+ltn+nFVaPAZcMcr3RCqbDwE9pbRncMFMttIaVbqe1L3MPraPBZl2G35CWJFVOi2ElSdLJMRwkSRXDQZJUMRwkSRXDQZJUMRwkSRXDQZJUMRwkSZX/A3ywvkDirAUFAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# visualize basic dataset statistics\n", "df1[\"age\"].hist()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data exploration\n", "\n", "Are there differences in the distribution of risk scores by gender or race?\n", "\n" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a207bed68>" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAD/BJREFUeJzt3X+snmV9x/H3Z+AcUicQ5KSWZoclnRNtRD0hbCTL6VgmwrLqHywQhkXZ6h/ocGuyVf/RxJD0D9HNzJFUYbDI6Aiw0Chzss4TYjJ/tEgs2BEb7aDQgU4HFI2u+N0f5649p5ae0+fHuY9X36/k5Lmf61z3fX2fC87n3OfqfT9PqgpJUrt+qe8CJEnjZdBLUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxhn0ktQ4g16SGndq3wUAnH322TU5Odl3GUN54YUXOP300/suY9lwPuZzPo5wLuYbZj527dr1vap69UL9lkXQT05OsnPnzr7LGMrMzAzT09N9l7FsOB/zOR9HOBfzDTMfSf5rMf1cupGkxhn0ktQ4g16SGmfQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMYtiztjhzG5+XO9jb1vy+W9jS1Ji+UZvSQ1zqCXpMYZ9JLUOINekhq3YNAnWZ3ki0n2JHk0yQ1d+4eTPJnk4e7rsjn7fCDJ3iSPJXnrOF+AJOn4FnPVzSFgU1U9lOSVwK4kD3Tf+3hVfXRu5yTnA1cCrwdeA/xbkt+oqhdHWbgkaXEWPKOvqgNV9VC3/TywB1h1nF3WA9uq6sdV9R1gL3DhKIqVJJ24VNXiOyeTwIPAG4C/AK4FngN2MnvW/4Mkfwt8uao+0+1zC/AvVXX3UcfaCGwE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UBmD1xBM4Z9QAG/YgkWQHcA7y/qp7ru54+JPkD4Jmq2tV3LcvEqcCbgZur6k3AC4zhz/JfFN3a83rgPOA1wOlJ/rjfqk4OBv0IJHkZsyF/R1Xd23c9PboY+MMk+5h9x9LfTfKZfkvq1X5gf1Ud/gvvbmaD/2T1e8B3quq7VfV/wL3Ab/dc03LwdJKVAN3jM6MewKAfUpIwuwa7p6o+1nc9faqqD1TVuVU1yew/sv17VZ20Z2xV9d/AE0le2zVdAnyzx5L69jhwUZJXdD83l3AS/+P0HNuBDd32BuC+UQ8wtjtjTyIXA9cAu5M83LV9sLszWHofcEf3nk/fBt7Vcz29qaqvJLkbeIjZq9W+zkl2l2ySO4Fp4Owk+4EPAVuAu5Jcx+wvwytGPq53xkpS21y6kaTGGfSS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcQa9JDXu/wGGc1MgBVO79wAAAABJRU5ErkJggg==\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# compute score histograms by race and by gender \n", "df_f = df2[(df2.sex == 'Female')]\n", "df_f[\"decile_score\"].hist()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a2083b860>" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEGJJREFUeJzt3X2MXXWdx/H3Z6kolChPMmHbZgdj40NsjOwEURIzilEejOUPyeKyWgib/sMiShOt/sNmNyaYrI/ZDZtGkJolIIskNMqqpDAx+weNPBgBq6GLLIxUi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5JchmDkLxwwY/rlcCS1CangCSpUQaAJDXKAJCkRhkAktQoA0CSGmUASFKjDABJapQBIEmN+n/nc2SUw/+P6AAAAABJRU5ErkJggg==\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df_m = df2[(df2.sex == 'Male')]\n", "df_m[\"decile_score\"].hist()\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a214b5cf8>" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEvZJREFUeJzt3XGMXWed3vHvQxzAa2+T0ISRsa06K9ztZtcigVGaLVI1TlAx2arOSk0VRMFhU3krBcpWbovhj7LbbaRUItAi0ajeTbDpUrxRCIqVuNumhilCKmHjkI1jvAgvSZOJvfayJF4m0GyH/vrHHDMz3onn+s6duZM33490dc9573vO+d1XnueeeX3OnVQVkqR2vW7YBUiSlpZBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWrcqmEXAHD55ZfXpk2bhl3Gorz00kusWbNm2GWsGI7HXI7HDMdirsWMx+HDh79fVVcs1G9FBP2mTZt47LHHhl3GooyPjzM2NjbsMlYMx2Mux2OGYzHXYsYjyf/upZ9TN5LUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxBr0kNc6gl6TGGfSS1LgVcWfsYmza/fDQjv3Mnb8ytGNLUq88o5ekxhn0ktQ4g16SGmfQS1LjFgz6JG9M8s0kf5TkaJLf6tr3Jnk6yRPd4+quPUk+k+R4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nCrGrpVwOokq4Cf4Zz7a1pXVV8DfnBO83ZgX7e8D7hp0Mc16AcoySbgGuDR4VYyVP8e+FfA/xt2ISvAzwF/Bnyum8r63SRrhl3UsFTV88AngWeBk8CZqvrvw61qRRipqpMwfeIIvHnQBzDoByTJWuBLwG9U1V8Mu55hSPL3gdNVdXjYtawQq4C3A3dX1TXASyzBr+WvFt3c83bgSuAtwJok/3i4Vb02GPQDkORipkP+C1X1wLDrGaJ3Av8gyTNMf2Pp9Ul+b7glDdUEMFFVZ3/Du5/p4H+tehfwdFX9WVX9X+AB4O8MuaaV4FSSdQDd8+lBH8CgX6QkYXoO9lhVfWrY9QxTVX2sqjZU1Sam/5PtK1X1mj1jq6o/BZ5L8vNd0w3At4dY0rA9C1yX5Ge6n5sbeA3/5/QsB4Ad3fIO4MFBH2DJ7ox9DXkn8H7gSJInuraPd3cGSx8GvtB959P3gA8OuZ6hqapHk9wPPM701Wrf4jV2l2ySLwJjwOVJJoBPAHcC9yW5jekPw5sHflzvjJWktjl1I0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWrc/wcQXlsRTqvaJQAAAABJRU5ErkJggg==\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df_aa = df2[(df2.race == 'African-American')]\n", "df_aa[\"decile_score\"].hist()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a2157f6a0>" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQ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dXX2/I/Mf+NfMVeCZxkE3AH8PFJ1zJpSd4I/BzwIEBV/bCqvj/ZqiZuHXB1knXAj7PENTa9qqqvAN+7YHgncLAtHwTuHMe2DfoRSrIFeA/w5GQrmag/AX4b+LdJF3IJ+Ang74D/0Q5lfTzJNZMualKq6rvAHwHPA6eAM1X1F5OtauKmquoUzO80Am8dx0YM+hFJci3wWeA3quofJ13PJCT5ReB0VR2ZdC2XiHXAjcADVfUe4GXG9E/zy0E7/rwTeBvwn4Brkvy3yVZ1ZTDoRyDJ65gP+U9X1ecmXc8E3Qz8UpITzN+19L1J/udkS5qoWWC2qs79C+8R5oP/SvXzwP+tqr+rqv8PfA74LxOuadJeTLIBoD2eHsdGDPpVShLmj8Eeq6o/nnQ9k1RVv1NVm6pqC/O/ZPtSVV2xe2xV9bfAC0ne3oZ2AN+eYEmT9jywPcmPt++bHVzBv5xuDgG72vIu4NFxbGQsV8ZeYW4G3g8cTfJ0G/vddnWw9EHg0+2+T88B9064nompqieTPAJ8nfmz1b7BFXSVbJLPADPADUlmgd8D9gMPJ9nN/A/Cu8ayba+MlaS+eehGkjpn0EtS5wx6SeqcQS9JnTPoJalzBr0kdc6gl6TOGfSS1Ll/BwSi9nHRCC0aAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df_wh = df2[(df2.race == 'Caucasian')]\n", "df_wh[\"decile_score\"].hist()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a2167a6d8>" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEaCAYAAAAYOoCaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW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PhqRRGQDSyhyuqkN9NyGdCF4FJK3MfUn+PrAmyWbgXQy+00E65XgEIK3MO4EfBr7J4FvdngL8Sk+dkrwKSJIa5RSQtAxLXelTVZcutl1ajQwAaXleBRxkMO2zF7/ER88ATgFJy5BkDfB64EoGnwD6e8BtVXV/r41JY/AksLQMVfXtqvpkVW0DLgJmgc8meWfPrUkjcwpIWqYkpwNvZnAUsAm4AfhEnz1J43AKSFqGJDuBlwK/D9xeVff13JI0NgNAWoYk3wG+1q0O/9E0/6UiOnUZAJLUKE8CS1KjDABJapQBIEmNMgAkqVEGgCQ16v8D9VhDynFPKnQAAAAASUVORK5CYII=\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df_aa[\"score_text\"].value_counts().plot(kind='bar')" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a21743470>" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEaCAYAAAAYOoCaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAE59JREFUeJzt3X2wXHd93/H3Byk2Dy7IxhdCJTkyjSapAyR4bo0JNENRMTZQy3/Erd0QBHVGfXAgqZsJpplWCTRTSFsMTlNPFCwsT4gNQ+lYkygQx0CdtLFimSfZOK5vFGrd2MGXypYpDFDhb//Yo7CWru7DrrTnyr/3a+bOnvM9v93zvbNz93PP75zdTVUhSWrPM/puQJLUDwNAkhplAEhSowwASWqUASBJjTIAJKlRBoAkNcoAkKRGGQCS1KjVfTewkLPPPrs2bNjQdxuSdEq55557vlZVU4uNW9EBsGHDBvbu3dt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=\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df_wh[\"score_text\"].value_counts().plot(kind='bar')" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a21805080>" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEaCAYAAAD3+OukAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAE81JREFUeJzt3X+w5XV93/HnyyWiEQlYrg7ZZbPorOkAmlVvCak/htQqP5KCdsZmtzWu1syqAzFO2pliOy3ElGmSBu2QpKRr3ICTCKUllp1k1SCTStIKsqsbdhGpFyRy3R1YpQKNKZ1d3v3jfK8cl/v73D3fvXyej5kz55z39/P9ft93ztz7ut/P93vOSVUhSWrT8/puQJLUH0NAkhpmCEhSwwwBSWqYISBJDTMEJKlhhoAkNcwQkKSGGQKS1LAT+m5gIaeddlpt2LCh7zYkadXYs2fPt6tqYjFjj/sQ2LBhA7t37+67DUlaNZL81WLHOh0kSQ0zBCSpYYaAJDXMEJCkhhkCktQwQ0CSGmYISFLDDAFJapghIEkNO+7fMTxOG674k75bOKYe+rWf6bsFSceZBY8EkuxI8miS/UO1/5xkb3d7KMnerr4hyd8MLfvdoXVel2Rfkqkk1ybJsfmRJEmLtZgjgeuB3wY+OVOoqp+beZzkGuDxofEPVNWmWbZzHbANuBPYBVwIfGbpLUuSVsqCRwJVdQfw2GzLuv/m/xFw43zbSHI6cHJVfbGqikGgvG3p7UqSVtKoJ4bfCDxSVV8fqp2Z5CtJvpDkjV1tLTA9NGa6q80qybYku5PsPnTo0IgtSpLmMmo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yt77eI45JHAcSDJN6tqfd99aGFJfmzo6WHgkapq8oSinhs8Ejg+pO8GNL8kJ1fVE8CTRy06OQlV9VgffWlxksz7Lu+WPzvIEDg+eDh2/PsUgyuB9jB4vYaDu4CX99GUFm3P0ONfAa7sq5HjjdNBY5LkSWb/Yx/ghVVlIEtjkOQrVfWavvs4XviHZ0yqyhNSq1iS18633M8OWlX8z3eIISAtzjXd/QuASeAvGRzFvRq4C3hDT31JIzEEpEWoqp8GSHITsG3me6GTnAP88z5708KOmo794SRPzCxi8AGAJ/fTWf8MAWlp/vZMAABU1f4km/psSAtzOnZuhoC0NPcl+T3gDxj8Z/lO/OwgrWJeHSQtQZIXAB9g8PWgAHcA11XV/+2vK2n5DAFpiZK8EFhfVff33Ys0quf13YC0miS5BNgLfLZ7vinJzn67kpbPEJCW5krgXOC7AFW1F9jQZ0PSKAwBaWkOV9XjfTchrRSvDpKWZn+SfwysSbIR+CCD74SQViWPBKSl+UXgbOApBt8O9wTg14Nq1fLqIElqmNNB0iIsdAVQVV0y33LpeGUISIvzU8DDDKaA7sIvAtJzhNNB0iIkWQO8BdjC4JND/wS4saru7bUxaUSeGJYWoaqOVNVnq2orcB4wBfz3JL/Yc2vSSJwOkhYpyYnAzzA4GtgAXAv8UZ89SaNyOkhahCQ3AOcAnwFuqqr9PbckrQhDQFqEJE8Df909Hf6laf5LSbS6GQKS1DBPDEtSwwwBSWqYISBJDTMEJKlhhoAkNez/A/w9XV7nzNsKAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df_aa[\"v_score_text\"].value_counts().plot(kind='bar')" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<matplotlib.axes._subplots.AxesSubplot at 0x1a218bc6d8>" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA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00i6L4b7YlWt7bsXzS3J26vq95JcPtf2qvropHs6WjgFNGHdG/33fWq0mwL6WD8daSkOOpVwGTAFOP9/dHtBd/t3eu3iKOQewFEgyUNVdWrffWhhSX5oaHU/8I2qavIAoo597gEcHdJ3A5pfkhdW1ePAtw7a9MIkVNXePvrSwpLM+8ntlr8LyAA4OrgbdvT7fQZn/NzF4PUaDu0CXtZHU1qUu4aWfx24sq9GjjZOAU1Ikm8x9xt9gOdVlWEsHWFJvlxVr+67j6OFbzoTUlUegDqGJTljvu1+F9Axw/94hxgA0uL8x+72ucA08FUGe2+vArYBb+ipL2lkBoC0CFX1MwBJbgQ2HLiOc5JXAL/cZ2+a30HTr89P8viBTQy+yO+F/XTWPwNAWpofO/DmD1BV9yb5iT4b0vycfj00A0BamvuTfAL4PQb/Vb4dvwtIxyjPApKWIMlzgV9kcElPgNuBa6rqu/11JY3GAJCWKMnzgFOr6oG+e5HG8Zy+G5COJUkuAL4CfLZb/4kkW/rtShqNASAtzZXAmcBjAFX1FWBNnw1JozIApKXZX1X7+m5COhw8C0hamnuT/GNgWZK1wHsYXNNBOua4ByAtzbuBlwNPMLiq2+OAl/TUMcmzgCSpUU4BSYuw0Jk+VXXBfNulo5EBIC3O64BdDKZ9tuFFfPQs4BSQtAhJlgFvBi5h8A2gfwTcUFU7em1MGoMHgaVFqKonq+qzVbUeOAuYAb6Q5N09tyaNzCkgaZGSHA+8lcFewBrgauAzffYkjcMpIGkRkmwGXgH8MXBjVd3bc0vS2AwAaRGSPAV8u1sd/qNp/qIiOnYZAJLUKA8CS1KjDABJapQBIEmNMgAkqVEGgCQ16v8D0d7BsvETo+wAAAAASUVORK5CYII=\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "df_wh[\"v_score_text\"].value_counts().plot(kind='bar')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Data analysis\n", "\n", "See [ProPublica article](https://www.propublica.org/article/how-we-analyzed-the-compas-recidivism-algorithm) for details. When evaluating performance of the prediction instrument, we consider **accuracy** and **parity** (or **balance**).\n", "\n", "- **High false-positives rates** Of those deemed likely to re-offend, in any crime category, only 61 percent were arrested for any subsequent crimes within two years. Only 20 percent of people predicted to commit violent crimes actually went on to do so.\n", "\n", "- **Racial skew in scores** Scores for white defendants were skewed toward lower-risk categories. Scores for black defendants were not -- a symptom of a potential problem.\n", "\n", "- **Racial skew in false-positive rates** 44.9% of African Americans are labeled high-risk but don't reoffend, compared to 23.5% of Caucasians.\n", "\n", "- **Racial skew in false-negative rates** 47.7% of Caucasians are labeled low-risk but do re-offend, compared to 28% of African Americans." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Be a data skeptic!\n", "\n", "What do we mean when we say that data is biased? Societal bias? Measurement bias?\n", "\n", "Consider the COMPAS questionaire. Race is not one of the questions. Then why are we seeing a difference in recidivism scores across the populations?\n", "\n", "### Be a technology skeptic!\n", "\n", "African Americans have higher recidivism rates. [Recent results](https://arxiv.org/abs/1703.00056) show that when recidivism rates are different across sub-populations, then we cannot simultaneously equalize false-positive rates and false-negative rates! \n", "\n", "This is **not** a technical issue: it is not our definition that's flawed! Our society exhibits structural bias, which processes like those studies here reinforce.\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.0" } }, "nbformat": 4, "nbformat_minor": 2 }