(pred, all_human_scores)
| 50 | return None |
| 51 | |
| 52 | def compute_correlation_uniquehuman(pred, all_human_scores): |
| 53 | num_workers = 3 |
| 54 | import scipy.stats |
| 55 | |
| 56 | pred = np.around(pred, decimals=4) |
| 57 | |
| 58 | spearman = 0 |
| 59 | for worker_i in range(num_workers): |
| 60 | tmp, p_value = scipy.stats.spearmanr(pred, all_human_scores[:, worker_i]) |
| 61 | assert p_value < 0.01 |
| 62 | spearman += tmp |
| 63 | spearman /= num_workers |
| 64 | spearman = np.around(spearman, decimals=4) |
| 65 | |
| 66 | kendalltau = 0 |
| 67 | for worker_i in range(num_workers): |
| 68 | tmp, p_value = scipy.stats.kendalltau(pred, all_human_scores[:, worker_i]) |
| 69 | assert p_value < 0.01 |
| 70 | kendalltau += tmp |
| 71 | kendalltau /= num_workers |
| 72 | kendalltau = np.around(kendalltau, decimals=4) |
| 73 | |
| 74 | print('kendall: {}, spear: {}'.format(kendalltau, spearman)) |
| 75 | return kendalltau, spearman |
| 76 | |
| 77 | |
| 78 | def normalize_matrix(A): |
nothing calls this directly
no outgoing calls
no test coverage detected