Skip to content

Commit

Permalink
0.8+R@10 (erikbern#5)
Browse files Browse the repository at this point in the history
* u

Signed-off-by: Nicky <[email protected]>

* 0.8+R@10

Co-authored-by: Tinkerrr <[email protected]>
Co-authored-by: Erik Bernhardsson <[email protected]>
  • Loading branch information
3 people authored Mar 2, 2020
1 parent 2949ee8 commit b74b0a4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ install/*.yaml
install/lib-*/
data/*
*.class

.idea/
18 changes: 18 additions & 0 deletions ann_benchmarks/plotting/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,34 @@ def dist_computations(queries, attrs):
"worst": float("-inf"),
"lim": [0.0, 1.03]
},
"k-nn_0.8": {
"description": "Recall 0.8+",
"function": lambda true_distances, run_distances, metrics, run_attrs: knn(true_distances, run_distances, run_attrs["count"], metrics).attrs['mean'], # noqa
"worst": float("-inf"),
"lim": [0.80, 1.03]
},
"epsilon": {
"description": "Epsilon 0.01 Recall",
"function": lambda true_distances, run_distances, metrics, run_attrs: epsilon(true_distances, run_distances, run_attrs["count"], metrics).attrs['mean'], # noqa
"worst": float("-inf")
},
"epsilon_0.8": {
"description": "Epsilon 0.01 Recall 0.8+",
"function": lambda true_distances, run_distances, metrics, run_attrs: epsilon(true_distances, run_distances, run_attrs["count"], metrics).attrs['mean'], # noqa
"worst": float("-inf"),
"lim": [0.80, 1.03]
},
"largeepsilon": {
"description": "Epsilon 0.1 Recall",
"function": lambda true_distances, run_distances, metrics, run_attrs: epsilon(true_distances, run_distances, run_attrs["count"], metrics, 0.1).attrs['mean'], # noqa
"worst": float("-inf")
},
"largeepsilon_0.8": {
"description": "Epsilon 0.1 Recall 0.8+",
"function": lambda true_distances, run_distances, metrics, run_attrs: epsilon(true_distances, run_distances, run_attrs["count"], metrics, 0.1).attrs['mean'], # noqa
"worst": float("-inf"),
"lim": [0.80, 1.03]
},
"rel": {
"description": "Relative Error",
"function": lambda true_distances, run_distances, metrics, run_attrs: rel(true_distances, run_distances, metrics), # noqa
Expand Down
11 changes: 10 additions & 1 deletion ann_benchmarks/plotting/plot_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,14 @@
"recall/candidates": ("k-nn", "candidates"),
"recall/qpssize": ("k-nn", "queriessize"),
"eps/time": ("epsilon", "qps"),
"largeeps/time": ("largeepsilon", "qps")
"largeeps/time": ("largeepsilon", "qps"),

"recall_0.8/time": ("k-nn_0.8", "qps"),
"recall_0.8/buildtime": ("k-nn_0.8", "build"),
"recall_0.8/indexsize": ("k-nn_0.8", "indexsize"),
"recall_0.8/distcomps": ("k-nn_0.8", "distcomps"),
"recall_0.8/candidates": ("k-nn_0.8", "candidates"),
"recall_0.8/qpssize": ("k-nn_0.8", "queriessize"),
"eps_0.8/time": ("epsilon_0.8", "qps"),
"largeeps_0.8/time": ("largeepsilon_0.8", "qps")
}
4 changes: 4 additions & 0 deletions ann_benchmarks/plotting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def create_pointset(data, xn, yn):
for algo, algo_name, xv, yv in data:
if not xv or not yv:
continue
if "lim" in xm and not (xm["lim"][0] <= xv <= xm["lim"][1]):
continue
if "lim" in ym and not (ym["lim"][0] <= yv <= ym["lim"][1]):
continue
axs.append(xv)
ays.append(yv)
als.append(algo_name)
Expand Down

0 comments on commit b74b0a4

Please sign in to comment.