@@ -1524,10 +1524,10 @@ set the number of neighbors $K$ to 1, 7, 20, and 300.
1524
1524
1525
1525
### Evaluating on the test set
1526
1526
1527
- Now that we have tuned the KNN classifier and set $K =$ {glue: text }` best_k_unique ` ,
1527
+ Now that we have tuned the K-NN classifier and set $K =$ {glue: text }` best_k_unique ` ,
1528
1528
we are done building the model and it is time to evaluate the quality of its predictions on the held out
1529
1529
test data, as we did earlier in {numref}` eval-performance-clasfcn2 ` .
1530
- We first need to retrain the KNN classifier
1530
+ We first need to retrain the K-NN classifier
1531
1531
on the entire training data set using the selected number of neighbors.
1532
1532
Fortunately we do not have to do this ourselves manually; ` scikit-learn ` does it for
1533
1533
us automatically. To make predictions and assess the estimated accuracy of the best model on the test data, we can use the
@@ -1654,7 +1654,7 @@ The overall workflow for performing K-nearest neighbors classification using `sc
1654
1654
In these last two chapters, we focused on the K-nearest neighbors algorithm,
1655
1655
but there are many other methods we could have used to predict a categorical label.
1656
1656
All algorithms have their strengths and weaknesses, and we summarize these for
1657
- the $K$ -NN here.
1657
+ the K -NN here.
1658
1658
1659
1659
** Strengths:** K-nearest neighbors classification
1660
1660
@@ -1927,7 +1927,7 @@ In particular, you
1927
1927
2 . tune each one using cross-validation, and
1928
1928
3 . pick the subset of predictors that gives you the highest cross-validation accuracy.
1929
1929
1930
- Best subset selection is applicable to any classification method ($K$ -NN or otherwise).
1930
+ Best subset selection is applicable to any classification method (K -NN or otherwise).
1931
1931
However, it becomes very slow when you have even a moderate
1932
1932
number of predictors to choose from (say, around 10). This is because the number of possible predictor subsets
1933
1933
grows very quickly with the number of predictors, and you have to train the model (itself
0 commit comments