Skip to content

Commit adc8b9d

Browse files
committed
Fixes to last few figure and notebox break issues
1 parent ac01d72 commit adc8b9d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

classification1.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ The new imbalanced data is shown in Figure \@ref(fig:05-unbalanced).
10961096
set.seed(3)
10971097
```
10981098

1099-
```{r 05-unbalanced, fig.height = 3.5, fig.width = 4.5, fig.cap = "Imbalanced data."}
1099+
```{r 05-unbalanced, fig.height = 3.5, fig.width = 4.5, fig.pos = "H", out.extra="", fig.cap = "Imbalanced data."}
11001100
rare_cancer <- bind_rows(
11011101
filter(cancer, Class == "B"),
11021102
cancer |> filter(Class == "M") |> slice_head(n = 3)

regression1.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ of our method on observations not seen during training. And finally, we can use
9191
choices of model parameters (e.g., K in a K-nearest neighbors model). The major difference
9292
is that we are now predicting numerical variables instead of categorical variables.
9393

94+
\newpage
95+
9496
> **Note:** You can usually tell whether a \index{categorical variable}\index{numerical variable}
9597
> variable is numerical or categorical&mdash;and therefore whether you
9698
> need to perform regression or classification&mdash;by taking two response variables X and Y from your

regression2.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ linear regression predicted line of best fit. By default `geom_smooth` adds some
291291
to the plot that we are not interested in at this point; we provide the argument `se = FALSE` to
292292
tell `geom_smooth` not to show that information. Figure \@ref(fig:08-lm-predict-all) displays the result.
293293

294-
```{r 08-lm-predict-all, fig.height = 3.5, fig.width = 4.5, warning = FALSE, message = FALSE, fig.cap = "Scatter plot of sale price versus size with line of best fit for the full Sacramento housing data."}
294+
```{r 08-lm-predict-all, fig.height = 3.5, fig.width = 4.5, warning = FALSE, fig.pos = "H", out.extra="", message = FALSE, fig.cap = "Scatter plot of sale price versus size with line of best fit for the full Sacramento housing data."}
295295
lm_plot_final <- ggplot(sacramento_train, aes(x = sqft, y = price)) +
296296
geom_point(alpha = 0.4) +
297297
xlab("House size (square feet)") +
@@ -825,7 +825,7 @@ df <- df |>
825825
df
826826
```
827827

828-
```{r 08-predictor-design, message = FALSE, warning = FALSE, echo = FALSE, fig.height = 3.5, fig.width = 4.5, fig.pos = "H", out.extra="", fig.cap = "Example of a data set with a nonlinear relationship between the predictor and the response."}
828+
```{r 08-predictor-design, message = FALSE, warning = FALSE, echo = FALSE, fig.height = 3.5, fig.width = 4.5, fig.cap = "Example of a data set with a nonlinear relationship between the predictor and the response."}
829829
curve_plt <- ggplot(df, aes(x = x, y = y)) +
830830
geom_point() +
831831
xlab("x") +
@@ -870,13 +870,13 @@ a deep understanding of the problem&mdash;as well as the wrangling tools
870870
from previous chapters&mdash;to engineer useful new features that improve
871871
predictive performance.
872872

873-
\newpage
874-
875873
> **Note:** Feature engineering
876874
> is *part of tuning your model*, and as such you must not use your test data
877875
> to evaluate the quality of the features you produce. You are free to use
878876
> cross-validation, though!
879877
878+
\newpage
879+
880880
## The other sides of regression
881881

882882
So far in this textbook we have used regression only in the context of

0 commit comments

Comments
 (0)