提交 da001769 编写于 作者: L LielinJiang 提交者: qingqing01

Fix arguement k of recall_topk method never been used (#3150)

上级 28db32b7
......@@ -87,9 +87,11 @@ def recall_topk(fea, lab, k = 1):
sorted_index = np.argsort(d, 1)
res = 0
for i in range(len(fea)):
pred = lab[sorted_index[i][0]]
if lab[i] == pred:
res += 1.0
for j in range(k):
pred = lab[sorted_index[i][j]]
if lab[i] == pred:
res += 1.0
break
res = res / len(fea)
return res
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册