Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating ggplot lines with linewidth aes #185

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 05_word_embeddings.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ tibble(frac = 2 ^ seq(-16, -6, 2)) %>%
`RAM (in bytes)` = map_dbl(dfm, lobstr::obj_size)) %>%
pivot_longer(sparsity:`RAM (in bytes)`, names_to = "measure") %>%
ggplot(aes(words, value, color = measure)) +
geom_line(size = 1.5, alpha = 0.5) +
geom_line(linewidth = 1.5, alpha = 0.5) +
geom_point(size = 2) +
facet_wrap(~measure, scales = "free_y") +
scale_x_log10(labels = scales::label_comma()) +
Expand Down
8 changes: 4 additions & 4 deletions 06_ml_regression.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ These values are quantitative estimates for how well our model performed, and ca
svm_rs %>%
collect_predictions() %>%
ggplot(aes(year, .pred, color = id)) +
geom_abline(lty = 2, color = "gray80", size = 1.5) +
geom_abline(lty = 2, color = "gray80", linewidth = 1.5) +
geom_point(alpha = 0.3) +
labs(
x = "Truth",
Expand Down Expand Up @@ -352,7 +352,7 @@ This looks pretty promising, so let's explore the predictions for this random fo
```{r rfpredict, dependson="scotusrfrs", opts.label = "fig.large", fig.cap="The random forest model did not perform very sensibly across years, compared to our first attempt using a linear SVM model"}
collect_predictions(rf_rs) %>%
ggplot(aes(year, .pred, color = id)) +
geom_abline(lty = 2, color = "gray80", size = 1.5) +
geom_abline(lty = 2, color = "gray80", linewidth = 1.5) +
geom_point(alpha = 0.3) +
labs(
x = "Truth",
Expand Down Expand Up @@ -981,7 +981,7 @@ Now that all of the models with possible parameter values have been trained, we
final_rs %>%
collect_metrics() %>%
ggplot(aes(max_tokens, mean, color = .metric)) +
geom_line(size = 1.5, alpha = 0.5) +
geom_line(linewidth = 1.5, alpha = 0.5) +
geom_point(size = 2, alpha = 0.9) +
facet_wrap(~.metric, scales = "free_y", ncol = 1) +
theme(legend.position = "none") +
Expand Down Expand Up @@ -1114,7 +1114,7 @@ We can also examine how the true and predicted years compare for the testing set
final_fitted %>%
collect_predictions() %>%
ggplot(aes(year, .pred)) +
geom_abline(lty = 2, color = "gray80", size = 1.5) +
geom_abline(lty = 2, color = "gray80", linewidth = 1.5) +
geom_point(alpha = 0.3) +
labs(
x = "Truth",
Expand Down