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

Function pearson

experiments/human_eval/draw_model_eval_ggbench_minimal.py:95–100  ·  view source on GitHub ↗
(xs: list[float], ys: list[float])

Source from the content-addressed store, hash-verified

93
94
95def pearson(xs: list[float], ys: list[float]) -> float:
96 x_bar, y_bar = sum(xs) / len(xs), sum(ys) / len(ys)
97 num = sum((x - x_bar) * (y - y_bar) for x, y in zip(xs, ys))
98 den_x = math.sqrt(sum((x - x_bar) ** 2 for x in xs))
99 den_y = math.sqrt(sum((y - y_bar) ** 2 for y in ys))
100 return num / (den_x * den_y)
101
102
103def regression(xs: list[float], ys: list[float]) -> tuple[float, float]:

Callers 2

draw_pngFunction · 0.70
write_svgFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected