Skip to content

Commit 685a22d

Browse files
added points to predsel subsec cls2 bughunt
1 parent d510f31 commit 685a22d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

source/classification2.Rmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,7 @@ res <- tibble(ks = ks, accs = accs, fixedaccs = fixedaccs, nghbrs = nghbrs)
14001400
14011401
plt_irrelevant_accuracies <- ggplot(res) +
14021402
geom_line(mapping = aes(x=ks, y=accs)) +
1403+
geom_point(mapping = aes(x=ks, y=accs)) +
14031404
labs(x = "Number of Irrelevant Predictors",
14041405
y = "Model Accuracy Estimate") +
14051406
theme(text = element_text(size = 18), axis.title=element_text(size=18))
@@ -1420,6 +1421,7 @@ this evidence; if we fix the number of neighbors to $K=3$, the accuracy falls of
14201421

14211422
```{r 06-neighbors-irrelevant-features, echo = FALSE, warning = FALSE, fig.retina = 2, out.width = "65%", fig.align = "center", fig.cap = "Tuned number of neighbors for varying number of irrelevant predictors."}
14221423
plt_irrelevant_nghbrs <- ggplot(res) +
1424+
geom_point(mapping = aes(x=ks, y=nghbrs)) +
14231425
geom_line(mapping = aes(x=ks, y=nghbrs)) +
14241426
labs(x = "Number of Irrelevant Predictors",
14251427
y = "Tuned number of neighbors") +
@@ -1434,6 +1436,7 @@ res_tmp <- res %>% pivot_longer(cols=c("accs", "fixedaccs"),
14341436
values_to="accuracy")
14351437
14361438
plt_irrelevant_nghbrs <- ggplot(res_tmp) +
1439+
geom_point(mapping = aes(x=ks, y=accuracy, color=Type)) +
14371440
geom_line(mapping = aes(x=ks, y=accuracy, color=Type)) +
14381441
labs(x = "Number of Irrelevant Predictors", y = "Accuracy") +
14391442
scale_color_manual(labels= c("Tuned K", "K = 3"), values = c("darkorange", "steelblue")) +
@@ -1661,6 +1664,7 @@ where the elbow occurs, and whether adding a variable provides a meaningful incr
16611664
16621665
fwd_sel_accuracies_plot <- accuracies |>
16631666
ggplot(aes(x = size, y = accuracy)) +
1667+
geom_point() +
16641668
geom_line() +
16651669
labs(x = "Number of Predictors", y = "Estimated Accuracy") +
16661670
theme(text = element_text(size = 20), axis.title=element_text(size=20))

0 commit comments

Comments
 (0)