redisbench-admin 0.11.66__py3-none-any.whl → 0.11.68__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. redisbench_admin/run/args.py +1 -0
  2. redisbench_admin/run/cluster.py +1 -3
  3. redisbench_admin/run_remote/remote_db.py +3 -1
  4. redisbench_admin/run_remote/remote_helpers.py +27 -11
  5. redisbench_admin/run_remote/run_remote.py +11 -8
  6. redisbench_admin/run_remote/standalone.py +6 -2
  7. redisbench_admin/utils/benchmark_config.py +6 -2
  8. redisbench_admin/utils/local.py +4 -2
  9. redisbench_admin/utils/remote.py +81 -33
  10. {redisbench_admin-0.11.66.dist-info → redisbench_admin-0.11.68.dist-info}/METADATA +5 -2
  11. redisbench_admin-0.11.68.dist-info/RECORD +117 -0
  12. {redisbench_admin-0.11.66.dist-info → redisbench_admin-0.11.68.dist-info}/WHEEL +1 -1
  13. redisbench_admin/run/ann/pkg/.dockerignore +0 -2
  14. redisbench_admin/run/ann/pkg/.git +0 -1
  15. redisbench_admin/run/ann/pkg/.github/workflows/benchmarks.yml +0 -100
  16. redisbench_admin/run/ann/pkg/.gitignore +0 -21
  17. redisbench_admin/run/ann/pkg/LICENSE +0 -21
  18. redisbench_admin/run/ann/pkg/README.md +0 -157
  19. redisbench_admin/run/ann/pkg/algos.yaml +0 -1294
  20. redisbench_admin/run/ann/pkg/algosP.yaml +0 -67
  21. redisbench_admin/run/ann/pkg/ann_benchmarks/__init__.py +0 -2
  22. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/__init__.py +0 -0
  23. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/annoy.py +0 -26
  24. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/balltree.py +0 -22
  25. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/base.py +0 -36
  26. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/bruteforce.py +0 -110
  27. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/ckdtree.py +0 -17
  28. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/datasketch.py +0 -29
  29. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/definitions.py +0 -187
  30. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/diskann.py +0 -190
  31. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dolphinnpy.py +0 -31
  32. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dummy_algo.py +0 -25
  33. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elasticsearch.py +0 -107
  34. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elastiknn.py +0 -124
  35. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss.py +0 -124
  36. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_gpu.py +0 -61
  37. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_hnsw.py +0 -39
  38. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/flann.py +0 -27
  39. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/hnswlib.py +0 -36
  40. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kdtree.py +0 -22
  41. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kgraph.py +0 -39
  42. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/lshf.py +0 -25
  43. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/milvus.py +0 -99
  44. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/mrpt.py +0 -41
  45. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/n2.py +0 -28
  46. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nearpy.py +0 -48
  47. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nmslib.py +0 -74
  48. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/onng_ngt.py +0 -100
  49. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/opensearchknn.py +0 -107
  50. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/panng_ngt.py +0 -79
  51. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pinecone.py +0 -39
  52. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/puffinn.py +0 -45
  53. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pynndescent.py +0 -115
  54. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/qg_ngt.py +0 -102
  55. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/redisearch.py +0 -90
  56. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/rpforest.py +0 -20
  57. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/scann.py +0 -34
  58. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/sptag.py +0 -28
  59. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/subprocess.py +0 -246
  60. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vald.py +0 -149
  61. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vecsim-hnsw.py +0 -43
  62. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vespa.py +0 -47
  63. redisbench_admin/run/ann/pkg/ann_benchmarks/constants.py +0 -1
  64. redisbench_admin/run/ann/pkg/ann_benchmarks/data.py +0 -48
  65. redisbench_admin/run/ann/pkg/ann_benchmarks/datasets.py +0 -620
  66. redisbench_admin/run/ann/pkg/ann_benchmarks/distance.py +0 -53
  67. redisbench_admin/run/ann/pkg/ann_benchmarks/main.py +0 -325
  68. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/__init__.py +0 -2
  69. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/metrics.py +0 -183
  70. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/plot_variants.py +0 -17
  71. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/utils.py +0 -165
  72. redisbench_admin/run/ann/pkg/ann_benchmarks/results.py +0 -71
  73. redisbench_admin/run/ann/pkg/ann_benchmarks/runner.py +0 -333
  74. redisbench_admin/run/ann/pkg/create_dataset.py +0 -12
  75. redisbench_admin/run/ann/pkg/create_hybrid_dataset.py +0 -147
  76. redisbench_admin/run/ann/pkg/create_text_to_image_ds.py +0 -117
  77. redisbench_admin/run/ann/pkg/create_website.py +0 -272
  78. redisbench_admin/run/ann/pkg/install/Dockerfile +0 -11
  79. redisbench_admin/run/ann/pkg/install/Dockerfile.annoy +0 -5
  80. redisbench_admin/run/ann/pkg/install/Dockerfile.datasketch +0 -4
  81. redisbench_admin/run/ann/pkg/install/Dockerfile.diskann +0 -29
  82. redisbench_admin/run/ann/pkg/install/Dockerfile.diskann_pq +0 -31
  83. redisbench_admin/run/ann/pkg/install/Dockerfile.dolphinn +0 -5
  84. redisbench_admin/run/ann/pkg/install/Dockerfile.elasticsearch +0 -45
  85. redisbench_admin/run/ann/pkg/install/Dockerfile.elastiknn +0 -61
  86. redisbench_admin/run/ann/pkg/install/Dockerfile.faiss +0 -18
  87. redisbench_admin/run/ann/pkg/install/Dockerfile.flann +0 -10
  88. redisbench_admin/run/ann/pkg/install/Dockerfile.hnswlib +0 -10
  89. redisbench_admin/run/ann/pkg/install/Dockerfile.kgraph +0 -6
  90. redisbench_admin/run/ann/pkg/install/Dockerfile.mih +0 -4
  91. redisbench_admin/run/ann/pkg/install/Dockerfile.milvus +0 -27
  92. redisbench_admin/run/ann/pkg/install/Dockerfile.mrpt +0 -4
  93. redisbench_admin/run/ann/pkg/install/Dockerfile.n2 +0 -5
  94. redisbench_admin/run/ann/pkg/install/Dockerfile.nearpy +0 -5
  95. redisbench_admin/run/ann/pkg/install/Dockerfile.ngt +0 -13
  96. redisbench_admin/run/ann/pkg/install/Dockerfile.nmslib +0 -10
  97. redisbench_admin/run/ann/pkg/install/Dockerfile.opensearchknn +0 -43
  98. redisbench_admin/run/ann/pkg/install/Dockerfile.puffinn +0 -6
  99. redisbench_admin/run/ann/pkg/install/Dockerfile.pynndescent +0 -4
  100. redisbench_admin/run/ann/pkg/install/Dockerfile.redisearch +0 -18
  101. redisbench_admin/run/ann/pkg/install/Dockerfile.rpforest +0 -5
  102. redisbench_admin/run/ann/pkg/install/Dockerfile.scann +0 -5
  103. redisbench_admin/run/ann/pkg/install/Dockerfile.scipy +0 -4
  104. redisbench_admin/run/ann/pkg/install/Dockerfile.sklearn +0 -4
  105. redisbench_admin/run/ann/pkg/install/Dockerfile.sptag +0 -30
  106. redisbench_admin/run/ann/pkg/install/Dockerfile.vald +0 -8
  107. redisbench_admin/run/ann/pkg/install/Dockerfile.vespa +0 -17
  108. redisbench_admin/run/ann/pkg/install.py +0 -70
  109. redisbench_admin/run/ann/pkg/logging.conf +0 -34
  110. redisbench_admin/run/ann/pkg/multirun.py +0 -298
  111. redisbench_admin/run/ann/pkg/plot.py +0 -159
  112. redisbench_admin/run/ann/pkg/protocol/bf-runner +0 -10
  113. redisbench_admin/run/ann/pkg/protocol/bf-runner.py +0 -204
  114. redisbench_admin/run/ann/pkg/protocol/ext-add-query-metric.md +0 -51
  115. redisbench_admin/run/ann/pkg/protocol/ext-batch-queries.md +0 -77
  116. redisbench_admin/run/ann/pkg/protocol/ext-prepared-queries.md +0 -77
  117. redisbench_admin/run/ann/pkg/protocol/ext-query-parameters.md +0 -47
  118. redisbench_admin/run/ann/pkg/protocol/specification.md +0 -194
  119. redisbench_admin/run/ann/pkg/requirements.txt +0 -14
  120. redisbench_admin/run/ann/pkg/requirements_py38.txt +0 -11
  121. redisbench_admin/run/ann/pkg/results/fashion-mnist-784-euclidean.png +0 -0
  122. redisbench_admin/run/ann/pkg/results/gist-960-euclidean.png +0 -0
  123. redisbench_admin/run/ann/pkg/results/glove-100-angular.png +0 -0
  124. redisbench_admin/run/ann/pkg/results/glove-25-angular.png +0 -0
  125. redisbench_admin/run/ann/pkg/results/lastfm-64-dot.png +0 -0
  126. redisbench_admin/run/ann/pkg/results/mnist-784-euclidean.png +0 -0
  127. redisbench_admin/run/ann/pkg/results/nytimes-256-angular.png +0 -0
  128. redisbench_admin/run/ann/pkg/results/sift-128-euclidean.png +0 -0
  129. redisbench_admin/run/ann/pkg/run.py +0 -12
  130. redisbench_admin/run/ann/pkg/run_algorithm.py +0 -3
  131. redisbench_admin/run/ann/pkg/templates/chartjs.template +0 -102
  132. redisbench_admin/run/ann/pkg/templates/detail_page.html +0 -23
  133. redisbench_admin/run/ann/pkg/templates/general.html +0 -58
  134. redisbench_admin/run/ann/pkg/templates/latex.template +0 -30
  135. redisbench_admin/run/ann/pkg/templates/summary.html +0 -60
  136. redisbench_admin/run/ann/pkg/test/__init__.py +0 -0
  137. redisbench_admin/run/ann/pkg/test/test-jaccard.py +0 -19
  138. redisbench_admin/run/ann/pkg/test/test-metrics.py +0 -99
  139. redisbench_admin-0.11.66.dist-info/RECORD +0 -243
  140. {redisbench_admin-0.11.66.dist-info → redisbench_admin-0.11.68.dist-info}/entry_points.txt +0 -0
  141. {redisbench_admin-0.11.66.dist-info → redisbench_admin-0.11.68.dist-info/licenses}/LICENSE +0 -0
@@ -1,12 +0,0 @@
1
- import os
2
- import pathlib
3
-
4
- from ann_benchmarks.main import main
5
- from multiprocessing import freeze_support
6
-
7
- if __name__ == "__main__":
8
- workdir = pathlib.Path(__file__).parent.absolute()
9
- print("Changing the workdir to {}".format(workdir))
10
- os.chdir(workdir)
11
- freeze_support()
12
- main()
@@ -1,3 +0,0 @@
1
- from ann_benchmarks.runner import run_from_cmdline
2
-
3
- run_from_cmdline()
@@ -1,102 +0,0 @@
1
- <h3>{{xlabel}}/{{ylabel}}</h3>
2
- <div id="{{ xlabel }}{{ ylabel }}{{ label }}">
3
- <canvas id="chart{{ xlabel }}{{ ylabel }}{{ label }}" width="800" height="600"></canvas>
4
- <script>
5
- var ctx = document.getElementById("chart{{ xlabel }}{{ ylabel }}{{ label }}");
6
- var chart = new Chart(ctx, {
7
- {% if not render_all_points %}
8
- type: "line",
9
- {% else %}
10
- type: "bubble",
11
- {% endif %}
12
- data: { datasets: [
13
- {% for run in data_points %}
14
- {
15
- label: "{{ run["name"] }}",
16
- fill: false,
17
- pointStyle: "{{ linestyle[run["name"]][3] }}",
18
- borderColor: "{{ linestyle[run["name"]][0] }}",
19
- data: [
20
- {% for (x, y), l in zip(run["coords"], run["labels"]) %}
21
- { x: {{ x }} , y: {{ y }}, label: "{{ l }}" },
22
- {% endfor %}
23
- ]
24
- },
25
- {% endfor %}
26
- ]},
27
- options: {
28
- responsive: false,
29
- title:{
30
- display:true,
31
- text: '{{ plot_label }}'
32
- },
33
- scales: {
34
- xAxes: [{
35
- display: true,
36
- type: 'linear',
37
- max: '1',
38
- position: 'bottom',
39
- scaleLabel: {
40
- display: true,
41
- labelString: ' {{ xlabel }} '
42
- }
43
- }],
44
- yAxes: [{
45
- display: true,
46
- type: 'logarithmic',
47
- scaleLabel: {
48
- display: true,
49
- labelString: ' {{ ylabel }} '
50
- }
51
- }]
52
- }
53
- }
54
- });
55
- function pushOrConcat(base, toPush) {
56
- if (toPush) {
57
- if (Chart.helpers.isArray(toPush)) {
58
- // base = base.concat(toPush);
59
- Array.prototype.push.apply(base, toPush);
60
- } else {
61
- base.push(toPush);
62
- }
63
- }
64
-
65
- return base;
66
- }
67
- Chart.Tooltip.prototype.getFooter = function(tooltipItem, data) {
68
- var me = this;
69
- var callbacks = me._options.callbacks;
70
- var item = tooltipItem[0];
71
-
72
- var beforeFooter = callbacks.beforeFooter.apply(me, arguments);
73
- var footer = "Parameters: " + data.datasets[item.datasetIndex].data[item.index].label || '';
74
- var afterFooter = callbacks.afterFooter.apply(me, arguments);
75
-
76
- var lines = [];
77
- lines = pushOrConcat(lines, beforeFooter);
78
- lines = pushOrConcat(lines, footer);
79
- lines = pushOrConcat(lines, afterFooter);
80
-
81
- return lines;
82
- }
83
-
84
- </script>
85
- </div>
86
- {% if args.latex %}
87
- <div class="row">
88
- <div class="col-md-4 text-center">
89
- <button type="button" id="button_{{button_label}}" class="btn btn-default" >Toggle latex code</button>
90
- </div>
91
- </div>
92
- <script>
93
- $("#button_{{button_label}}").click(function() {
94
- $("#plot_{{button_label}}").toggle();
95
- });
96
- </script>
97
- <div id="plot_{{button_label}}" style="display:none">
98
- <pre>
99
- {{latex_code}}
100
- </pre>
101
- </div>
102
- {% endif %}
@@ -1,23 +0,0 @@
1
- {% extends "general.html" %}
2
- {% block content %}
3
- <div class="container">
4
- {% for item in plot_data.keys() %}
5
- {% if item=="normal" %}
6
- {% if batch %}
7
- <h2>Plots for {{title}} in batch mode</h2>
8
- {% else %}
9
- <h2>Plots for {{title}}</h2>
10
- {% endif %}
11
- {% elif item=="scatter" and args.scatter %}
12
- {% if batch %}
13
- <h2>Scatterplots for {{title}} in batch mode</h2>
14
- {% else %}
15
- <h2>Scatterplots for {{title}}</h2>
16
- {% endif %}
17
- {% endif %}
18
- {% for plot in plot_data[item] %}
19
- {{ plot }}
20
- {% endfor %}
21
- <hr />
22
- {% endfor %}
23
- {% endblock %}
@@ -1,58 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width, initial-scale=1">
7
- <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8
- <title>{{ title }}</title>
9
- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.js"></script>
10
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
11
- <!-- Include all compiled plugins (below), or include individual files as needed -->
12
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
13
- <!-- Bootstrap -->
14
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
15
- <style>
16
- body { padding-top: 50px; }
17
- </style>
18
- <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
19
- <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
20
- <!--[if lt IE 9]>
21
- <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
22
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
23
- <![endif]-->
24
- </head>
25
- <body>
26
-
27
- <nav class="navbar navbar-inverse navbar-fixed-top">
28
- <div class="container">
29
- <div class="navbar-header">
30
- <a class="navbar-brand" href="index.html">ANN Benchmarks</a>
31
- </div>
32
- <div id="navbar" class="collapse navbar-collapse">
33
- <ul class="nav navbar-nav">
34
- <li class="active"><a href="index.html">Home</a></li>
35
- </ul>
36
- <ul class="nav navbar-nav">
37
- <li class="active"><a href="index.html#datasets">Datasets</a></li>
38
- </ul>
39
- <ul class="nav navbar-nav">
40
- <li class="active"><a href="index.html#algorithms">Algorithms</a></li>
41
- </ul>
42
- <ul class="nav navbar-nav">
43
- <li class="active"><a href="index.html#contact">Contact</a></li>
44
- </ul>
45
- </div><!--/.nav-collapse -->
46
- </div>
47
- </nav>
48
-
49
- {% block content %} {% endblock %}
50
-
51
- <div id="contact">
52
- <h2>Contact</h2>
53
- <p>ANN-Benchmarks has been developed by Martin Aumueller (maau@itu.dk), Erik Bernhardsson (mail@erikbern.com), and Alec Faitfull (alef@itu.dk). Please use
54
- <a href="https://github.com/erikbern/ann-benchmarks/">Github</a> to submit your implementation or improvements.</p>
55
- </div>
56
- </div>
57
- </body>
58
- </html>
@@ -1,30 +0,0 @@
1
-
2
- \begin{figure}
3
- \centering
4
- \begin{tikzpicture}
5
- \begin{axis}[
6
- xlabel={ {{xlabel}} },
7
- ylabel={ {{ylabel}} },
8
- ymode = log,
9
- yticklabel style={/pgf/number format/fixed,
10
- /pgf/number format/precision=3},
11
- legend style = { anchor=west},
12
- cycle list name = black white
13
- ]
14
- {% for algo in plot_data %}
15
- {% if algo.scatter %}
16
- \addplot [only marks] coordinates {
17
- {% else %}
18
- \addplot coordinates {
19
- {% endif %}
20
- {% for coord in algo.coords %}
21
- ({{ coord[0]}}, {{ coord[1] }})
22
- {% endfor %}
23
- };
24
- \addlegendentry{ {{algo.name}} };
25
- {% endfor %}
26
- \end{axis}
27
- \end{tikzpicture}
28
- \caption{ {{caption}} }
29
- \label{}
30
- \end{figure}
@@ -1,60 +0,0 @@
1
- {% extends "general.html" %}
2
- {% block content %}
3
- <div class="container">
4
- <h1>Info</h1>
5
- <p>ANN-Benchmarks is a benchmarking environment for approximate nearest neighbor algorithms search. This website contains the current benchmarking results. Please visit <a href="http://github.com/erikbern/ann-benchmarks/">http://github.com/erikbern/ann-benchmarks/</a> to get an overview over evaluated data sets and algorithms. Make a pull request on <a href="http://github.com/erikbern/ann-benchmarks/">Github</a> to add your own code or improvements to the
6
- benchmarking system.
7
- </p>
8
- <div id="results">
9
- <h1>Benchmarking Results</h1>
10
- <p>Results are split by distance measure and dataset. In the bottom, you can find an overview of an algorithm's performance on all datasets. Each dataset is annoted
11
- by <em>(k = ...)</em>, the number of nearest neighbors an algorithm was supposed to return. The plot shown depicts <em>Recall</em> (the fraction
12
- of true nearest neighbors found, on average over all queries) against <em>Queries per second</em>. Clicking on a plot reveils detailled interactive plots, including
13
- approximate recall, index size, and build time.</p>
14
- {% for type in ['non-batch', 'batch'] %}
15
- {% if len(dataset_with_distances[type]) > 0 %}
16
- {% if type == 'batch' %}
17
- <h2>Benchmarks for Batched Queries</h2>
18
- {% else %}
19
- <h2>Benchmarks for Single Queries</h2>
20
- {% endif %}
21
-
22
- <h2 id ="datasets">Results by Dataset</h2>
23
- {% for distance_data in dataset_with_distances[type] %}
24
- <h3>Distance: {{ distance_data.name }} </h3>
25
- {% for entry in distance_data.entries %}
26
- <a href="./{{ entry.name }}.html">
27
- <div class="row" id="{{entry.name}}">
28
- <div class = "col-md-4 bg-success">
29
- <h4>{{entry.desc}}</h4>
30
- </div>
31
- <div class = "col-md-8">
32
- <img class = "img-responsive" src="{{ entry.name }}.png" />
33
- </div>
34
- </div>
35
- </a>
36
- <hr />
37
- {% endfor %}
38
- {% endfor %}
39
- <h2 id="algorithms">Results by Algorithm</h2>
40
- <ul class="list-inline"><b>Algorithms:</b>
41
- {% for algo in algorithms[type].keys() %}
42
- <li><a href="#{{algo}}">{{algo}}</a></li>
43
- {% endfor %}
44
- </ul>
45
- {% for algo in algorithms[type].keys()%}
46
- <a href="./{{ algo }}.html">
47
- <div class="row" id="{{algo}}">
48
- <div class = "col-md-4 bg-success">
49
- <h4>{{algo}}</h4>
50
- </div>
51
- <div class = "col-md-8">
52
- <img class = "img-responsive" src="{{ algo }}.png" />
53
- </div>
54
- </div>
55
- </a>
56
- <hr />
57
- {% endfor %}
58
- {% endif %}
59
- {% endfor %}
60
- {% endblock %}
File without changes
@@ -1,19 +0,0 @@
1
- import unittest
2
- import numpy
3
- from ann_benchmarks.distance import jaccard
4
-
5
- class TestJaccard(unittest.TestCase):
6
- def setUp(self):
7
- pass
8
-
9
- def test_similarity(self):
10
- a = [1, 2, 3, 4]
11
- b = []
12
- c = [1, 2]
13
- d = [5, 6]
14
-
15
- self.assertAlmostEqual(jaccard(a, b), 0.0)
16
- self.assertAlmostEqual(jaccard(a, a), 1.0)
17
- self.assertAlmostEqual(jaccard(a, c), 0.5)
18
- self.assertAlmostEqual(jaccard(c, d), 0.0)
19
-
@@ -1,99 +0,0 @@
1
- import unittest
2
- from ann_benchmarks.plotting.metrics import (
3
- knn, queries_per_second, index_size, build_time, candidates,
4
- epsilon, rel)
5
-
6
-
7
- class DummyMetric():
8
-
9
- def __init__(self):
10
- self.attrs = {}
11
- self.d = {}
12
-
13
- def __getitem__(self, key):
14
- return self.d.get(key, None)
15
-
16
- def __setitem__(self, key, value):
17
- self.d[key] = value
18
-
19
- def __contains__(self, key):
20
- return key in self.d
21
-
22
- def create_group(self, name):
23
- self.d[name] = DummyMetric()
24
- return self.d[name]
25
-
26
-
27
- class TestMetrics(unittest.TestCase):
28
-
29
- def setUp(self):
30
- pass
31
-
32
- def test_recall(self):
33
- exact_queries = [[0.1, 0.25]]
34
- run1 = [[]]
35
- run2 = [[0.2, 0.3]]
36
- run3 = [[0.2]]
37
- run4 = [[0.2, 0.25]]
38
-
39
- self.assertAlmostEqual(
40
- knn(exact_queries, run1, 2, DummyMetric()).attrs['mean'], 0.0)
41
- self.assertAlmostEqual(
42
- knn(exact_queries, run2, 2, DummyMetric()).attrs['mean'], 0.5)
43
- self.assertAlmostEqual(
44
- knn(exact_queries, run3, 2, DummyMetric()).attrs['mean'], 0.5)
45
- self.assertAlmostEqual(
46
- knn(exact_queries, run4, 2, DummyMetric()).attrs['mean'], 1.0)
47
-
48
- def test_epsilon_recall(self):
49
- exact_queries = [[0.05, 0.08, 0.24, 0.3]]
50
- run1 = [[]]
51
- run2 = [[0.1, 0.2, 0.55, 0.7]]
52
-
53
- self.assertAlmostEqual(
54
- epsilon(exact_queries, run1, 4, DummyMetric(), 1).attrs['mean'],
55
- 0.0)
56
-
57
- self.assertAlmostEqual(
58
- epsilon(exact_queries, run2, 4,
59
- DummyMetric(), 0.0001).attrs['mean'],
60
- 0.5)
61
- # distance can be off by factor (1 + 1) * 0.3 = 0.6 => recall .75
62
- self.assertAlmostEqual(
63
- epsilon(exact_queries, run2, 4, DummyMetric(), 1).attrs['mean'],
64
- 0.75)
65
- # distance can be off by factor (1 + 2) * 0.3 = 0.9 => recall 1
66
- self.assertAlmostEqual(
67
- epsilon(exact_queries, run2, 4, DummyMetric(), 2).attrs['mean'],
68
- 1.0)
69
-
70
- def test_relative(self):
71
- exact_queries = [[0.1, 0.2, 0.25, 0.3]]
72
- run1 = []
73
- run2 = [[0.1, 0.2, 0.25, 0.3]]
74
- run3 = [[0.1, 0.2, 0.55, 0.9]]
75
-
76
- self.assertAlmostEqual(
77
- rel(exact_queries, run1, DummyMetric()), float("inf"))
78
- self.assertAlmostEqual(rel(exact_queries, run2, DummyMetric()), 1)
79
- # total distance exact: 0.85, total distance run3: 1.75
80
- self.assertAlmostEqual(rel(exact_queries, run3, DummyMetric()),
81
- 1.75 / 0.85)
82
-
83
- def test_queries_per_second(self):
84
- self.assertAlmostEqual(
85
- queries_per_second([], {"best_search_time": 0.01}),
86
- 100)
87
-
88
- def test_index_size(self):
89
- self.assertEqual(index_size([], {"index_size": 100}), 100)
90
-
91
- def test_build_time(self):
92
- self.assertEqual(build_time([], {"build_time": 100}), 100)
93
-
94
- def test_candidates(self):
95
- self.assertEqual(candidates([], {"candidates": 10}), 10)
96
-
97
-
98
- if __name__ == '__main__':
99
- unittest.main()