@@ -5,6 +5,7 @@ library(formatR)
5
5
library(plotly)
6
6
library(knitr)
7
7
library(kableExtra)
8
+ library(ggpubr)
8
9
9
10
knitr::opts_chunk$set(echo = TRUE,
10
11
fig.align = "center")
@@ -903,7 +904,7 @@ Standardizing your data should be a part of the preprocessing you do
903
904
before predictive modeling and you should always think carefully about your problem domain and
904
905
whether you need to standardize your data.
905
906
906
- ``` {r 05-scaling-plt, echo = FALSE, fig.height = 4, fig.width = 10, fig. cap = "Comparison of K = 3 nearest neighbors with standardized and unstandardized data."}
907
+ ``` {r 05-scaling-plt, echo = FALSE, fig.height = 4, fig.cap = "Comparison of K = 3 nearest neighbors with standardized and unstandardized data."}
907
908
908
909
attrs <- c("Area", "Smoothness")
909
910
@@ -994,7 +995,8 @@ scaled <- ggplot(scaled_cancer, aes(x = Area,
994
995
yend = unlist(neighbors_scaled[3, attrs[2]])
995
996
), color = "black", size = 0.5)
996
997
997
- gridExtra::grid.arrange(unscaled, scaled, ncol = 2)
998
+ ggarrange(unscaled, scaled, ncol = 2, common.legend = TRUE, legend = "bottom")
999
+
998
1000
```
999
1001
1000
1002
``` {r 05-scaling-plt-zoomed, fig.height = 4, fig.width = 10, echo = FALSE, fig.cap = "Close up of three nearest neighbors for unstandardized data."}
0 commit comments