MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / kendall_tau

Function kendall_tau

experiments/analysis/analyze_human_score_correlation.py:61–76  ·  view source on GitHub ↗
(pairs: List[Tuple[float, float]])

Source from the content-addressed store, hash-verified

59
60
61def kendall_tau(pairs: List[Tuple[float, float]]) -> float:
62 concordant = 0
63 discordant = 0
64 for i in range(len(pairs)):
65 for j in range(i + 1, len(pairs)):
66 x_delta = pairs[i][0] - pairs[j][0]
67 y_delta = pairs[i][1] - pairs[j][1]
68 product = x_delta * y_delta
69 if product > 0:
70 concordant += 1
71 elif product < 0:
72 discordant += 1
73 total = concordant + discordant
74 if total <= 0:
75 return 0.0
76 return (concordant - discordant) / total
77
78
79def bootstrap_ci(

Callers 1

build_resultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected