Skip to content

Commit

Permalink
Added AUC metric
Browse files Browse the repository at this point in the history
  • Loading branch information
HanXudong committed May 1, 2022
1 parent dd59442 commit 3423c78
Showing 1 changed file with 98 additions and 1 deletion.
99 changes: 98 additions & 1 deletion tutorial/plot_gallery.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Crete Plot"
"## Basic Plot"
]
},
{
Expand Down Expand Up @@ -118,6 +118,13 @@
"make_plot(Moji_plot_df)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Zoomed Plots"
]
},
{
"cell_type": "code",
"execution_count": 7,
Expand Down Expand Up @@ -145,6 +152,96 @@
" # figure_name = \"moji_fairlib\"\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## AUC - Performance-Fairness Tradeoff"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0.8888970059716558, 0.9854552013667007)"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEHCAYAAABbZ7oVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAvQklEQVR4nO3deXyV5Zn/8c+Vk30hCSQgJMgmomFRkKKWaq2OuI4WawUcpaOt1Fq3/n7a2k6rrdPfaJ1OR5y6YRdrtaBWcWzdizqoo1X2RaBSQAkIhrAlISHb9fvjPAlJSOCE5CQnOd/363VenPM8z33O9SQkV+7nup/7NndHRESkNQndHYCIiMQuJQkREWmTkoSIiLRJSUJERNqkJCEiIm1K7O4AOlNeXp4PHTq0u8MQEelRFi9evMPd81vb16uSxNChQ1m0aFF3hyEi0qOY2cdt7dPlJhERaZOShIiItElJQkRE2tSrahIiI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f4GU74r+3d7n5iG8dUtLG9tbn/D9Vuf/BvfZPnDa8TgX8i3LM4KfhlvYlw74AWx9cRXj+irc9v8+vWQo27N0zW1hiTu9cH9ZeG97rB3V9p9gFm/9zOWKWXUE1CulMZ4UswDV4Brg7+0sfMCsysv5kNAva5++PAz4EJbbRvTQLhmXMhvPzn2+6+F9hoZl8NPsfM7IQI4l1L+C/6Y4LXVwL/E0G7tmQTvvRUY2ZfAoYc6uAg7mIz+zI0jrxKp42v2xHG9ArhWYaTgvc61swy2hur9B7qSUi3cfdSM3vHzFYBL7n7rWZ2POEV1wDKgSuAY4B/N7N6oAb4VvAWc4CXzOxTd/9SGx9TAYw2s8XAHqBhGOs/AQ+a2Q8JX5efR3gu/0PFW2VmVxG+TJUIfAA8dKg2h/EE8CczWwQsI5yEDudK4GEzu5Pw1+Kr7v5qG1+3I1kD+1eELxctsfCblQBfPsJYpRfQVOHSq5lZubtndnccIj2VLjeJiEibdLlJegUz+yvNRygBXKlehEjH6HKTiIi0SZebRESkTUoSIiLSJiUJERFpk5KEiIi06f8DrcBWvjJOHBoAAAAASUVORK5CYII=",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"adv_pareto_df = Moji_plot_df[Moji_plot_df[\"Models\"]==\"Adv\"]\n",
"\n",
"image = sns.lineplot(\n",
" data=adv_pareto_df,\n",
" x=\"test_performance mean\",\n",
" y=\"test_fairness mean\",\n",
" hue=\"Models\",\n",
" markers=True,\n",
" style=\"Models\",\n",
" )\n",
"\n",
"_xlim = image.axes.get_xlim()\n",
"_ylim = image.axes.get_ylim()\n",
"\n",
"_tmp_df = fairlib.analysis.utils.auc_performance_fairness_tradeoff(\n",
" adv_pareto_df,\n",
" # random_performance = 0.5,\n",
" performance_threshold = 0.70, \n",
" # interpolation = \"constant\",\n",
" interpolation = \"linear\",\n",
" )[1]\n",
"\n",
"plt.fill_between(_tmp_df[\"test_performance mean\"], _tmp_df[\"test_fairness mean\"], alpha=0.30)\n",
"\n",
"plt.xlim(_xlim)\n",
"plt.ylim(_ylim)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.051836936857947394"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fairlib.analysis.utils.auc_performance_fairness_tradeoff(\n",
" adv_pareto_df,\n",
" # random_performance = 0.5,\n",
" performance_threshold = 0.70, \n",
" # interpolation = \"constant\",\n",
" interpolation = \"linear\",\n",
" )[0]"
]
}
],
"metadata": {
Expand Down

0 comments on commit 3423c78

Please sign in to comment.