Skip to content

Commit

Permalink
updated benchmark with ties
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek815 authored and YojanaGadiya committed May 24, 2021
1 parent d85b9d4 commit 19b1905
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions src/notebooks/6.0-benchmark_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
" index = np.where(cn == np.amin(cn))\n",
" # if list is full of 0's (i.e sum == 0), then there are no shared neighbors \n",
" \n",
" if np.sum(cn) == 0 or len(np.array(cn)[index]) > 1:\n",
" if np.sum(cn) == 0: #or len(np.array(cn)[index]) > 1:\n",
" continue \n",
" \n",
" for val in index:\n",
Expand Down Expand Up @@ -454,7 +454,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Calculating scores for algorithms: 100%|██████████| 11/11 [00:03<00:00, 3.19it/s]\n"
"Calculating scores for algorithms: 100%|██████████| 11/11 [00:06<00:00, 1.67it/s]\n"
]
}
],
Expand Down Expand Up @@ -544,66 +544,66 @@
" <tbody>\n",
" <tr>\n",
" <th>Common Neighbors</th>\n",
" <td>50.0</td>\n",
" <td>34.615</td>\n",
" <td>0.132</td>\n",
" <td>2/4</td>\n",
" <td>44.444</td>\n",
" <td>36/104</td>\n",
" <td>31.765</td>\n",
" <td>0.108</td>\n",
" <td>4/9</td>\n",
" <td>27/85</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Cosine Similiarity</th>\n",
" <td>43.75</td>\n",
" <td>0.132</td>\n",
" <td>7/16</td>\n",
" <td>42.857</td>\n",
" <td>38.889</td>\n",
" <td>0.108</td>\n",
" <td>6/14</td>\n",
" <td>14/36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Jaccard index</th>\n",
" <td>43.75</td>\n",
" <td>0.132</td>\n",
" <td>7/16</td>\n",
" <td>40.0</td>\n",
" <td>37.143</td>\n",
" <td>0.108</td>\n",
" <td>6/15</td>\n",
" <td>13/35</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sorensen index</th>\n",
" <td>43.75</td>\n",
" <td>0.132</td>\n",
" <td>7/16</td>\n",
" <td>40.0</td>\n",
" <td>37.143</td>\n",
" <td>0.108</td>\n",
" <td>6/15</td>\n",
" <td>13/35</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Hub Promoted Index</th>\n",
" <td>60.0</td>\n",
" <td>34.343</td>\n",
" <td>0.132</td>\n",
" <td>3/5</td>\n",
" <td>46.154</td>\n",
" <td>34/99</td>\n",
" <td>37.209</td>\n",
" <td>0.108</td>\n",
" <td>6/13</td>\n",
" <td>16/43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Hub Depressed Index</th>\n",
" <td>43.75</td>\n",
" <td>0.132</td>\n",
" <td>7/16</td>\n",
" <td>41.667</td>\n",
" <td>35.211</td>\n",
" <td>0.108</td>\n",
" <td>5/12</td>\n",
" <td>25/71</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Leicht–Holme–Newman Index</th>\n",
" <td>43.75</td>\n",
" <td>0.132</td>\n",
" <td>7/16</td>\n",
" <td>46.667</td>\n",
" <td>40.0</td>\n",
" <td>0.108</td>\n",
" <td>7/15</td>\n",
" <td>14/35</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Preferential Attachment</th>\n",
Expand All @@ -618,72 +618,72 @@
" <th>Adamic-Adar</th>\n",
" <td>33.333</td>\n",
" <td>0.132</td>\n",
" <td>2/6</td>\n",
" <td>36.364</td>\n",
" <td>30/90</td>\n",
" <td>32.143</td>\n",
" <td>0.108</td>\n",
" <td>4/11</td>\n",
" <td>18/56</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Resource Allocation Index</th>\n",
" <td>33.333</td>\n",
" <td>0.132</td>\n",
" <td>2/6</td>\n",
" <td>36.364</td>\n",
" <td>30/90</td>\n",
" <td>32.143</td>\n",
" <td>0.108</td>\n",
" <td>4/11</td>\n",
" <td>18/56</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Shortest Path</th>\n",
" <td>0.0</td>\n",
" <td>11.111</td>\n",
" <td>0.132</td>\n",
" <td>0/1</td>\n",
" <td>0.0</td>\n",
" <td>18/162</td>\n",
" <td>14.844</td>\n",
" <td>0.108</td>\n",
" <td>0/10</td>\n",
" <td>57/384</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" openbio_precision openbio_val_by_chance \\\n",
"Common Neighbors 50.0 0.132 \n",
"Common Neighbors 34.615 0.132 \n",
"Cosine Similiarity 43.75 0.132 \n",
"Jaccard index 43.75 0.132 \n",
"Sorensen index 43.75 0.132 \n",
"Hub Promoted Index 60.0 0.132 \n",
"Hub Promoted Index 34.343 0.132 \n",
"Hub Depressed Index 43.75 0.132 \n",
"Leicht–Holme–Newman Index 43.75 0.132 \n",
"Preferential Attachment 5.0 0.132 \n",
"Adamic-Adar 33.333 0.132 \n",
"Resource Allocation Index 33.333 0.132 \n",
"Shortest Path 0.0 0.132 \n",
"Shortest Path 11.111 0.132 \n",
"\n",
" # openbio_pairs custom_precision \\\n",
"Common Neighbors 2/4 44.444 \n",
"Cosine Similiarity 7/16 42.857 \n",
"Jaccard index 7/16 40.0 \n",
"Sorensen index 7/16 40.0 \n",
"Hub Promoted Index 3/5 46.154 \n",
"Hub Depressed Index 7/16 41.667 \n",
"Leicht–Holme–Newman Index 7/16 46.667 \n",
"Common Neighbors 36/104 31.765 \n",
"Cosine Similiarity 7/16 38.889 \n",
"Jaccard index 7/16 37.143 \n",
"Sorensen index 7/16 37.143 \n",
"Hub Promoted Index 34/99 37.209 \n",
"Hub Depressed Index 7/16 35.211 \n",
"Leicht–Holme–Newman Index 7/16 40.0 \n",
"Preferential Attachment 1/20 9.302 \n",
"Adamic-Adar 2/6 36.364 \n",
"Resource Allocation Index 2/6 36.364 \n",
"Shortest Path 0/1 0.0 \n",
"Adamic-Adar 30/90 32.143 \n",
"Resource Allocation Index 30/90 32.143 \n",
"Shortest Path 18/162 14.844 \n",
"\n",
" custom_val_by_chance # custom_pairs \n",
"Common Neighbors 0.108 4/9 \n",
"Cosine Similiarity 0.108 6/14 \n",
"Jaccard index 0.108 6/15 \n",
"Sorensen index 0.108 6/15 \n",
"Hub Promoted Index 0.108 6/13 \n",
"Hub Depressed Index 0.108 5/12 \n",
"Leicht–Holme–Newman Index 0.108 7/15 \n",
"Common Neighbors 0.108 27/85 \n",
"Cosine Similiarity 0.108 14/36 \n",
"Jaccard index 0.108 13/35 \n",
"Sorensen index 0.108 13/35 \n",
"Hub Promoted Index 0.108 16/43 \n",
"Hub Depressed Index 0.108 25/71 \n",
"Leicht–Holme–Newman Index 0.108 14/35 \n",
"Preferential Attachment 0.108 4/43 \n",
"Adamic-Adar 0.108 4/11 \n",
"Resource Allocation Index 0.108 4/11 \n",
"Shortest Path 0.108 0/10 "
"Adamic-Adar 0.108 18/56 \n",
"Resource Allocation Index 0.108 18/56 \n",
"Shortest Path 0.108 57/384 "
]
},
"execution_count": 15,
Expand Down

0 comments on commit 19b1905

Please sign in to comment.