ProPublica’s Misleading Machine Bias

from truth_tables import PeekyReader, Person, table, is_race, count, vtable, hightable, vhightable
from csv import DictReader

people = []
with open("./cox-parsed.csv") as f:
reader = PeekyReader(DictReader(f))
try:
while True:
p = Person(reader)
if p.valid:
people.append(p)
except StopIteration:
pass

pop = list(filter(lambda i: ((i.recidivist == True and i.lifetime <= 730) or
i.lifetime > 730), list(filter(lambda x: x.score_valid, people))))
recid = list(filter(lambda i: i.recidivist == True and i.lifetime <= 730, pop))
rset = set(recid)
surv = [i for i in pop if i not in rset]
Black defendants
Low High
Survived 990 805 0.49
Recidivated 532 1369 0.51
Total: 3696.00
False positive rate: 44.85
False negative rate: 27.99
Specificity: 0.55
Sensitivity: 0.72
Prevalence: 0.51
PPV: 0.63
NPV: 0.65
LR+: 1.61
LR-: 0.51
That number is higher for African Americans at 44.85%.
Compas Prediction AccuracyOther  66%
AA 59%
W 63%
H 65%
NA 66%
Asian 75%
Compas Prediction Metricsrace	precision  recall  f1
Other 24% 57% 34%
AA 62% 65% 64%
W 40% 64% 49%
H 32% 54% 40%
NA 90% 75% 81%
Asian 55% 71% 62%
Compas Prediction ParityRace    Predicted recidivism rate    Actual recidivism rate 
AA 49% 51%
W 25% 39%

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store