File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -719,8 +719,8 @@ cancer_train
719
719
720
720
Next, we create a * model specification* for \index{tidymodels!model specification} $K$-nearest neighbors classification
721
721
by calling the ` nearest_neighbor ` function, specifying that we want to use $K = 5$ neighbors
722
- (we will discuss how to choose $K$ in the next chapter) and the straight-line
723
- distance (` weight_func = "rectangular" ` ). The ` weight_func ` argument controls
722
+ (we will discuss how to choose $K$ in the next chapter) and that each neighboring point should have the same weight when voting
723
+ (` weight_func = "rectangular" ` ). The ` weight_func ` argument controls
724
724
how neighbors vote when classifying a new observation; by setting it to ` "rectangular" ` ,
725
725
each of the $K$ nearest neighbors gets exactly 1 vote as described above. Other choices,
726
726
which weigh each neighbor's vote differently, can be found on
You can’t perform that action at this time.
0 commit comments