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

Function regression

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

Source from the content-addressed store, hash-verified

140
141
142def regression(xs: list[float], ys: list[float]) -> tuple[float, float]:
143 x_bar = sum(xs) / len(xs)
144 y_bar = sum(ys) / len(ys)
145 slope = sum((x - x_bar) * (y - y_bar) for x, y in zip(xs, ys)) / sum((x - x_bar) ** 2 for x in xs)
146 intercept = y_bar - slope * x_bar
147 return slope, intercept
148
149
150def draw_rotated_axis_label(base: Image.Image, text: str) -> None:

Callers 1

draw_plotFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected