From e0ff07967c592d205bb1ead9849e18d754f66a9b Mon Sep 17 00:00:00 2001 From: wt Date: Thu, 16 Sep 2021 17:29:49 +0800 Subject: [PATCH] [skip ci] Add a comment about the calculation method of accuracy results (#8080) Signed-off-by: wangting0128 --- tests/benchmark/milvus_benchmark/runners/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/benchmark/milvus_benchmark/runners/utils.py b/tests/benchmark/milvus_benchmark/runners/utils.py index a882d612c4..c88cd12d8d 100644 --- a/tests/benchmark/milvus_benchmark/runners/utils.py +++ b/tests/benchmark/milvus_benchmark/runners/utils.py @@ -230,13 +230,21 @@ def gen_file_name(idx, dimension, data_type): def get_recall_value(true_ids, result_ids): """ Use the intersection length + true_ids: neighbors taken from the dataset + result_ids: ids returned by query """ sum_radio = 0.0 for index, item in enumerate(result_ids): # tmp = set(item).intersection(set(flat_id_list[index])) + + # Get the value of true_ids and the returned value to do the intersection tmp = set(true_ids[index]).intersection(set(item)) + + # Add up each ratio sum_radio = sum_radio + len(tmp) / len(item) # logger.debug(sum_radio) + + # Calculate the average ratio and take three digits after the decimal point return round(sum_radio / len(result_ids), 3)