FunctionRacerProblemsRace

Learn Then Predict

Beginnerscikit-learnPython

Each row of X describes one house and y holds the prices. Fit a linear regression to them and return its predictions for the rows of X_new.

Example 1

X [[1],[2],[3],[4]]
y [3,5,7,9]
X_new [[10],[0]]
returns [21.0,1.0]

The prices follow 1 + 2x, so x = 10 gives 21 and x = 0 gives 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 scikit-learn problems