-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ipynb
38 lines (38 loc) · 1.02 KB
/
.ipynb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import utils\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from fairness_algorithm import ILP\n",
"\n",
"fairness_tradeoff = 1.0\n",
"ranklist_length = 1\n",
"iteration_times = 20\n",
"if __name__ == \"__main__\":\n",
" qid_docidlist_dict,qid_reltensor_dict = utils.uniform(1,100,0.5)\n",
" ilp = ILP(qid_reltensor_dict,qid_docidlist_dict,utils.position_bias.singular(10),fairness_tradeoff)\n",
" for _ in range(iteration_times):\n",
" rl = ilp.get_ranking_list(0,ranklist_length)\n",
" #print(rl)\n",
" plt.plot([i for i in range(iteration_times)],ilp.unfairness_list)\n",
" plt.xlabel(\"iteration\")\n",
" plt.ylabel(\"unfairness\")\n",
" plt.show()"
]
}
],
"metadata": {
"language_info": {
"name": "python"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}