Skip to content

Commit

Permalink
consistency unknown legend cls1 bughunt
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorcampbell committed Dec 23, 2023
1 parent 6eef695 commit ed6db0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/classification1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Figure \@ref(fig:05-knn-1).
perim_concav_with_new_point <- bind_rows(cancer,
tibble(Perimeter = new_point[1],
Concavity = new_point[2],
Class = "unknown")) |>
Class = "Unknown")) |>
ggplot(aes(x = Perimeter,
y = Concavity,
color = Class,
Expand Down Expand Up @@ -379,7 +379,7 @@ not, if you consider the other nearby points.
perim_concav_with_new_point2 <- bind_rows(cancer,
tibble(Perimeter = new_point[1],
Concavity = new_point[2],
Class = "unknown")) |>
Class = "Unknown")) |>
ggplot(aes(x = Perimeter,
y = Concavity,
color = Class,
Expand Down Expand Up @@ -466,7 +466,7 @@ In order to find the $K=5$ nearest neighbors, we will use the `slice_min` functi
perim_concav <- bind_rows(cancer,
tibble(Perimeter = new_point[1],
Concavity = new_point[2],
Class = "unknown")) |>
Class = "Unknown")) |>
ggplot(aes(x = Perimeter,
y = Concavity,
color = Class,
Expand Down Expand Up @@ -950,7 +950,7 @@ whether you need to standardize your data.
attrs <- c("Area", "Smoothness")
# create a new obs and get its NNs
new_obs <- tibble(Area = 400, Smoothness = 0.135, Class = "unknown")
new_obs <- tibble(Area = 400, Smoothness = 0.135, Class = "Unknown")
my_distances <- table_with_distances(unscaled_cancer[, attrs],
new_obs[, attrs])
neighbors <- unscaled_cancer[order(my_distances$Distance), ]
Expand Down Expand Up @@ -989,7 +989,7 @@ unscaled <- ggplot(unscaled_cancer, aes(x = Area,
), color = "black", linewidth = 0.5, show.legend = FALSE)
# create new scaled obs and get NNs
new_obs_scaled <- tibble(Area = -0.72, Smoothness = 2.8, Class = "unknown")
new_obs_scaled <- tibble(Area = -0.72, Smoothness = 2.8, Class = "Unknown")
my_distances_scaled <- table_with_distances(scaled_cancer[, attrs],
new_obs_scaled[, attrs])
neighbors_scaled <- scaled_cancer[order(my_distances_scaled$Distance), ]
Expand Down Expand Up @@ -1141,7 +1141,7 @@ neighbors <- rare_cancer[order(my_distances$Distance), ]
rare_plot <- bind_rows(rare_cancer,
tibble(Perimeter = new_point[1],
Concavity = new_point[2],
Class = "unknown")) |>
Class = "Unknown")) |>
ggplot(aes(x = Perimeter, y = Concavity, color = Class, shape = Class)) +
geom_point(alpha = 0.5) +
labs(color = "Diagnosis",
Expand Down

0 comments on commit ed6db0e

Please sign in to comment.