File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -726,7 +726,8 @@ method as usual.
726
726
727
727
``` {code-cell} ipython3
728
728
729
- mlm = LinearRegression().fit(
729
+ mlm = LinearRegression()
730
+ mlm.fit(
730
731
sacramento_train[["sqft", "beds"]],
731
732
sacramento_train["price"]
732
733
)
@@ -838,11 +839,12 @@ Unfortunately you have to do this mapping yourself: the coefficients in `mlm.coe
838
839
in the * same order* as the columns of the predictor data frame you used when training.
839
840
So since we used ` sacramento_train[["sqft", "beds"]] ` when training,
840
841
we have that ` mlm.coef_[0] ` corresponds to ` sqft ` , and ` mlm.coef_[1] ` corresponds to ` beds ` .
842
+ Once you sort out the correspondence, you can then use those slopes to write a mathematical equation to describe the prediction plane:
841
843
842
844
``` {index} plane equation
843
845
```
844
846
845
- And then use those slopes to write a mathematical equation to describe the prediction plane:
847
+
846
848
847
849
$$ \text{house sale price} = \beta_0 + \beta_1\cdot(\text{house size}) + \beta_2\cdot(\text{number of bedrooms}), $$
848
850
where:
You can’t perform that action at this time.
0 commit comments