Skip to content

Commit ba04459

Browse files
fix M->Malignant, B->Benign causing missing rendered numbers
1 parent 44b29ee commit ba04459

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

source/classification1.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,8 @@ prediction <- predict(knn_fit, new_observation)
14381438
prediction
14391439
```
14401440

1441-
The classifier predicts that the first observation is benign ("B"), while the second is
1442-
malignant ("M"). Figure \@ref(fig:05-workflow-plot-show) visualizes the predictions that this
1441+
The classifier predicts that the first observation is benign, while the second is
1442+
malignant. Figure \@ref(fig:05-workflow-plot-show) visualizes the predictions that this
14431443
trained $K$-nearest neighbor model will make on a large range of new observations.
14441444
Although you have seen colored prediction map visualizations like this a few times now,
14451445
we have not included the code to generate them, as it is a little bit complicated.

source/classification2.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ train_prop <- cancer_train |>
410410
```
411411

412412
We can use `group_by` and `summarize` to \index{group\_by}\index{summarize} find the percentage of malignant and benign classes
413-
in `cancer_train` and we see about `r round(filter(train_prop, Class == "B")$proportion, 2)*100`% of the training
414-
data are benign and `r round(filter(train_prop, Class == "M")$proportion, 2)*100`%
413+
in `cancer_train` and we see about `r round(filter(train_prop, Class == "Benign")$proportion, 2)*100`% of the training
414+
data are benign and `r round(filter(train_prop, Class == "Malignant")$proportion, 2)*100`%
415415
are malignant, indicating that our class proportions were roughly preserved when we split the data.
416416

417417
```{r 06-train-proportion}
@@ -591,7 +591,7 @@ cancer_proportions
591591

592592
```{r 06-proportions-2, echo = FALSE, warning = FALSE}
593593
cancer_propn_1 <- cancer_proportions |>
594-
filter(Class == 'B') |>
594+
filter(Class == 'Benign') |>
595595
select(percent)
596596
```
597597

0 commit comments

Comments
 (0)