FunctionRacerProblemsRace

Best Fit Line

EasySciPyPython

Return [slope, intercept] of the least squares line through the points (xs[i], ys[i]).

Example 1

xs [0,1,2]
ys [1,3,5]
returns [2.0,1.0]

The points lie exactly on y = 2x + 1.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More SciPy problems