Skip to content

Commit 86a8f38

Browse files
Merge pull request #342 from UBC-DSCI/patch-pdf
Patch pdf
2 parents 81311be + cf61db5 commit 86a8f38

14 files changed

+29
-20
lines changed

build_html.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Script to generate HTML book
2-
docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.12.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience; Rscript _build_html.r"
2+
docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.15.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience; Rscript _build_html.r"

build_pdf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cp -r data/ pdf/data
2222
cp -r img/ pdf/img
2323

2424
# Build the book with bookdown
25-
docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.12.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience/pdf; Rscript _build_pdf.r"
25+
docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.15.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience/pdf; Rscript _build_pdf.r"
2626

2727
# clean files in pdf dir
2828
rm -rf pdf/references.bib

classification1.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,11 +1184,13 @@ fairly nuanced, and a careful treatment would require a lot more detail and math
11841184
For the present purposes, it will suffice to rebalance the data by *oversampling* the rare class. \index{oversampling}
11851185
In other words, we will replicate rare observations multiple times in our data set to give them more
11861186
voting power in the $K$-nearest neighbor algorithm. In order to do this, we will add an oversampling
1187-
step to the earlier `uc_recipe` recipe with the `step_upsample` function. \index{recipe!step\_upsample}
1187+
step to the earlier `uc_recipe` recipe with the `step_upsample` function from the `themis` R package. \index{recipe!step\_upsample}
11881188
We show below how to do this, and also
11891189
use the `group_by` and `summarize` functions to see that our classes are now balanced:
11901190

1191-
```{r 05-upsample-cancer, warning=FALSE}
1191+
```{r 05-upsample-cancer, warning = FALSE, message = FALSE}
1192+
library(themis)
1193+
11921194
ups_recipe <- recipe(Class ~ ., data = rare_cancer) |>
11931195
step_upsample(Class, over_ratio = 1, skip = FALSE) |>
11941196
prep()
153 KB
Loading
150 KB
Loading
249 KB
Loading
156 KB
Loading
156 KB
Loading

0 commit comments

Comments
 (0)