Skip to content

Commit

Permalink
Merge pull request #232 from spsanderson/development
Browse files Browse the repository at this point in the history
Fixes #231
  • Loading branch information
spsanderson authored Feb 9, 2024
2 parents 4d3fa9c + 53e962e commit c0fd37a
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ Imports:
broom,
ggplot2,
magrittr
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
21 changes: 14 additions & 7 deletions R/plot-regression-predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,24 @@ plot_regression_predictions <- function(.data, .output = "list"){
)
)
} else {
p <- .data |>

df <- .data |>
dplyr::group_by(.model_type, .data_category) |>
dplyr::mutate(x = dplyr::row_number()) |>
dplyr::ungroup()

act_data <- dplyr::filter(df, .data_type == "actual")
train_data <- dplyr::filter(df, .data_type == "training")
test_data <- dplyr::filter(df, .data_type == "testing")

p <- df |>
dplyr::group_by(.model_type, .data_category) |>
dplyr::mutate(x = dplyr::row_number()) |>
dplyr::ungroup() |>
ggplot2::ggplot(ggplot2::aes(x = x, y = .value)) +
ggplot2::geom_line(data = . %>% dplyr::filter(.data_type == "actual"),
color = "black") +
ggplot2::geom_line(data = . %>% dplyr::filter(.data_type == "training"),
linetype = "dashed", color = "red") +
ggplot2::geom_line(data = . %>% dplyr::filter(.data_type == "testing"),
linetype = "dashed", color = "blue") +
ggplot2::geom_line(data = act_data, color = "black") +
ggplot2::geom_line(data = train_data, linetype = "dashed", color = "red") +
ggplot2::geom_line(data = test_data, linetype = "dashed", color = "blue") +
ggplot2::facet_wrap(~ .model_type, ncol = 2, scales = "free") +
ggplot2::labs(
x = "",
Expand Down
2 changes: 1 addition & 1 deletion man/extract_model_spec.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/extract_regression_residuals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/extract_wflw_fit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/extract_wflw_pred.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/get_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/internal_make_fitted_wflw.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/internal_make_spec_tbl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/internal_make_wflw_gee_lin_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/internal_make_wflw_predictions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/internal_set_args_to_tune.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/make_classification_base_tbl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/make_regression_base_tbl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0fd37a

Please sign in to comment.