Skip to content

Commit

Permalink
changed percentile to quantile
Browse files Browse the repository at this point in the history
  • Loading branch information
Amandarg committed May 1, 2018
1 parent 06d854d commit 15ecdeb
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions COMPAS_debias_experiments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1396,38 +1396,6 @@
"In the COMPAS practitioners booklet, they rate anyone with a decile score above 8 as high risk. We can use this as a cutoff point."
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.49920144324\n",
"0.491612534292\n"
]
}
],
"source": [
"#biased\n",
"w,b = fit_logistic_regression(X_train, Y_train)\n",
"probabilities_biased = [logistic(w, X_test[i,:],b) for i in range(X_test.shape[0])]\n",
"\n",
"#debiased\n",
"w, b = fit_logistic_regression(X_post_debias_train, Y_train)\n",
"probabilities_debiased = [logistic(w, X_post_debias_test[i,:],b) for i in range(X_post_debias_test.shape[0])]\n",
"\n",
"high_risk_cutoff_biased = np.percentile(probabilities_biased, 50, interpolation='midpoint')\n",
"high_risk_cutoff_debiased = np.percentile(probabilities_debiased, 50, interpolation='midpoint')\n",
"\n",
"print(high_risk_cutoff_biased)\n",
"print(high_risk_cutoff_debiased)"
]
},
{
"cell_type": "code",
"execution_count": 32,
Expand Down

0 comments on commit 15ecdeb

Please sign in to comment.