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

Function pearson

experiments/human_eval/draw_model_eval_ggbench_style.py:133–139  ·  view source on GitHub ↗
(xs: list[float], ys: list[float])

Source from the content-addressed store, hash-verified

131
132
133def pearson(xs: list[float], ys: list[float]) -> float:
134 x_bar = sum(xs) / len(xs)
135 y_bar = sum(ys) / len(ys)
136 num = sum((x - x_bar) * (y - y_bar) for x, y in zip(xs, ys))
137 den_x = math.sqrt(sum((x - x_bar) ** 2 for x in xs))
138 den_y = math.sqrt(sum((y - y_bar) ** 2 for y in ys))
139 return num / (den_x * den_y)
140
141
142def regression(xs: list[float], ys: list[float]) -> tuple[float, float]:

Callers 1

draw_plotFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected