Learn Then Predict
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
- 4 to 40 rows, 1 to 3 columns
1 <= len(X_new) <= 8
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More scikit-learn problems
- Names to NumbersBeginner
- Same ScaleBeginner
- Share RightBeginner
- Typical Squared MissBeginner
- What the Model LearnedBeginner
- Zero to OneBeginner
- Curves From LinesEasy
- Fill the HolesEasy