You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# hidden seed -- make sure this is the same as what appears in reg2 right before train/test split
310
-
set.seed(10)
310
+
set.seed(7)
311
311
```
312
312
313
313
```{r 07-test-train-split}
@@ -512,13 +512,13 @@ Figure \@ref(fig:07-choose-k-knn-plot). What is happening here?
512
512
513
513
Figure \@ref(fig:07-howK) visualizes the effect of different settings of $K$ on the
514
514
regression model. Each plot shows the predicted values for house sale price from
515
-
our KNN regression model on the training data for 6 different values for $K$: 1, 3, `r kmin`, 41, 250, and 680 (almost the entire training set).
515
+
our KNN regression model on the training data for 6 different values for $K$: 1, 3, 25, `r kmin`, 250, and 680 (almost the entire training set).
516
516
For each model, we predict prices for the range of possible home sizes we
517
517
observed in the data set (here 500 to 5,000 square feet) and we plot the
518
518
predicted prices as a blue line.
519
519
520
520
```{r 07-howK, echo = FALSE, warning = FALSE, fig.height = 13, fig.width = 10,fig.cap = "Predicted values for house price (represented as a blue line) from KNN regression models for six different values for $K$."}
0 commit comments