Skip to content

Commit ed6db0e

Browse files
consistency unknown legend cls1 bughunt
1 parent 6eef695 commit ed6db0e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/classification1.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Figure \@ref(fig:05-knn-1).
324324
perim_concav_with_new_point <- bind_rows(cancer,
325325
tibble(Perimeter = new_point[1],
326326
Concavity = new_point[2],
327-
Class = "unknown")) |>
327+
Class = "Unknown")) |>
328328
ggplot(aes(x = Perimeter,
329329
y = Concavity,
330330
color = Class,
@@ -379,7 +379,7 @@ not, if you consider the other nearby points.
379379
perim_concav_with_new_point2 <- bind_rows(cancer,
380380
tibble(Perimeter = new_point[1],
381381
Concavity = new_point[2],
382-
Class = "unknown")) |>
382+
Class = "Unknown")) |>
383383
ggplot(aes(x = Perimeter,
384384
y = Concavity,
385385
color = Class,
@@ -466,7 +466,7 @@ In order to find the $K=5$ nearest neighbors, we will use the `slice_min` functi
466466
perim_concav <- bind_rows(cancer,
467467
tibble(Perimeter = new_point[1],
468468
Concavity = new_point[2],
469-
Class = "unknown")) |>
469+
Class = "Unknown")) |>
470470
ggplot(aes(x = Perimeter,
471471
y = Concavity,
472472
color = Class,
@@ -950,7 +950,7 @@ whether you need to standardize your data.
950950
attrs <- c("Area", "Smoothness")
951951
952952
# create a new obs and get its NNs
953-
new_obs <- tibble(Area = 400, Smoothness = 0.135, Class = "unknown")
953+
new_obs <- tibble(Area = 400, Smoothness = 0.135, Class = "Unknown")
954954
my_distances <- table_with_distances(unscaled_cancer[, attrs],
955955
new_obs[, attrs])
956956
neighbors <- unscaled_cancer[order(my_distances$Distance), ]
@@ -989,7 +989,7 @@ unscaled <- ggplot(unscaled_cancer, aes(x = Area,
989989
), color = "black", linewidth = 0.5, show.legend = FALSE)
990990
991991
# create new scaled obs and get NNs
992-
new_obs_scaled <- tibble(Area = -0.72, Smoothness = 2.8, Class = "unknown")
992+
new_obs_scaled <- tibble(Area = -0.72, Smoothness = 2.8, Class = "Unknown")
993993
my_distances_scaled <- table_with_distances(scaled_cancer[, attrs],
994994
new_obs_scaled[, attrs])
995995
neighbors_scaled <- scaled_cancer[order(my_distances_scaled$Distance), ]
@@ -1141,7 +1141,7 @@ neighbors <- rare_cancer[order(my_distances$Distance), ]
11411141
rare_plot <- bind_rows(rare_cancer,
11421142
tibble(Perimeter = new_point[1],
11431143
Concavity = new_point[2],
1144-
Class = "unknown")) |>
1144+
Class = "Unknown")) |>
11451145
ggplot(aes(x = Perimeter, y = Concavity, color = Class, shape = Class)) +
11461146
geom_point(alpha = 0.5) +
11471147
labs(color = "Diagnosis",

0 commit comments

Comments
 (0)