(embedding1, embedding2, top_k, sum_all=False)
| 35 | |
| 36 | |
| 37 | def calculate_R_precision(embedding1, embedding2, top_k, sum_all=False): |
| 38 | dist_mat = euclidean_distance_matrix(embedding1, embedding2) |
| 39 | argmax = np.argsort(dist_mat, axis=1) |
| 40 | top_k_mat = calculate_top_k(argmax, top_k) |
| 41 | if sum_all: |
| 42 | return top_k_mat.sum(axis=0) |
| 43 | else: |
| 44 | return top_k_mat |
| 45 | |
| 46 | |
| 47 | def calculate_matching_score(embedding1, embedding2, sum_all=False): |
nothing calls this directly
no test coverage detected