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

Function pearson

experiments/human_eval/draw_model_eval_ggbench_labeled.py:137–143  ·  view source on GitHub ↗
(xs: list[float], ys: list[float])

Source from the content-addressed store, hash-verified

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

Callers 2

draw_chartFunction · 0.70
write_svgFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected