You will list the residuals of a line, add up their squares, and work out as . The checker uses the stopping distances of the lesson and compares with the square of .
The idea. For each point the residual is . The SSE is the sum of their squares, and is the sum of the squares of .
Your tasks.
residuals(xs, ys, a, b). Return a list.sse(xs, ys, a, b).r_squared(xs, ys). Use the least-squares line from statistics.linear_regression.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…