FunctionRacerProblemsRace

Reading Off the Line

BeginnerstatsmodelsPython

x and y are past measurements. Find their least squares line with statsmodels and use it to forecast: return its height at new_x.

Example 1

x [0,1,2]
y [1,3,5]
new_x 10.0
returns 21.0

On y = 1 + 2x, x = 10 gives 21.

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 statsmodels problems