What the Model Learned
Fit a linear regression of y on the columns of X. Return a list with the intercept first, then the slope of each column in order.
Example 1
X [[1],[2],[3],[4]]
y [3,5,7,9]
returns [1.0,2.0]
The data follow y = 1 + 2x.
Constraints
- 4 to 40 rows, 1 to 3 columns
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More scikit-learn problems
- Zero to OneBeginner
- Curves From LinesEasy
- Fill the HolesEasy
- Found and FlaggedEasy
- One Column per NameEasy
- Score on Unseen RowsEasy
- Small TreeEasy
- Table of Hits and MissesEasy