Skip to content
Merged
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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

* Added an `augment()` method for `model_stack` objects (#173).

* Converted all character variables in the `tree_frogs` example data to factor
and updated downstream example objects (#177).

# stacks 1.0.1

* Removes an unneeded data import attribute from the `tree_frogs` example data
Expand Down
3 changes: 3 additions & 0 deletions data-raw/tree_frogs_tidy.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tree_frogs <-
treatment == "NT" ~ "control",
TRUE ~ NA_character_
),
treatment = factor(treatment, levels = c("gentamicin", "control")),
reflex = case_when(
age_groups_four == "4d_lowVOR" ~ "low",
age_groups_four == "4d_highVOR" ~ "mid",
Expand All @@ -40,11 +41,13 @@ tree_frogs <-
stimulus_h >= 12 & stimulus_h < 20 ~ "afternoon",
TRUE ~ NA_character_
),
t_o_d = factor(t_o_d, levels = c("morning", "afternoon", "night")),
hatched = case_when(
response == 1 ~ "yes",
response == 0 ~ "no",
TRUE ~ NA_character_
),
hatched = factor(hatched, levels = c("yes", "no")),
latency =
((age_days * 86400) + (hatch_h * 3600) + (hatch_m * 60) + hatch_s) - age
) %>%
Expand Down
Binary file modified data/class_folds.rda
Binary file not shown.
Binary file modified data/class_res_nn.rda
Binary file not shown.
Binary file modified data/class_res_rf.rda
Binary file not shown.
Binary file modified data/log_res_nn.rda
Binary file not shown.
Binary file modified data/log_res_rf.rda
Binary file not shown.
Binary file modified data/reg_folds.rda
Binary file not shown.
Binary file modified data/reg_res_lr.rda
Binary file not shown.
Binary file modified data/reg_res_sp.rda
Binary file not shown.
Binary file modified data/reg_res_svm.rda
Binary file not shown.
Binary file modified data/tree_frogs.rda
Binary file not shown.
Binary file modified data/tree_frogs_class_test.rda
Binary file not shown.
Binary file modified data/tree_frogs_reg_test.rda
Binary file not shown.
74 changes: 36 additions & 38 deletions tests/testthat/_snaps/print.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
# A tibble: 2 x 3
member type weight
<chr> <chr> <dbl>
1 reg_res_svm_1_3 svm_rbf 1.26
2 reg_res_svm_1_2 svm_rbf 0.135
1 reg_res_svm_1_3 svm_rbf 1.18
2 reg_res_svm_1_2 svm_rbf 0.203
Message

Members have not yet been fitted with `fit_members()`.
Expand All @@ -69,14 +69,14 @@
The 6 highest weighted member classes are:
Output
# A tibble: 6 x 4
member type weight class
<chr> <chr> <dbl> <fct>
1 .pred_full_class_res_rf_1_05 rand_forest 3.75 full
2 .pred_mid_class_res_rf_1_06 rand_forest 0.674 mid
3 .pred_full_class_res_rf_1_07 rand_forest 0.411 full
4 .pred_full_class_res_rf_1_01 rand_forest 0.0957 full
5 .pred_full_class_res_rf_1_06 rand_forest 0.0193 full
6 .pred_full_class_res_rf_1_04 rand_forest 0.0110 full
member type weight class
<chr> <chr> <dbl> <fct>
1 .pred_full_class_res_rf_1_05 rand_forest 3.81 full
2 .pred_mid_class_res_rf_1_06 rand_forest 0.674 mid
3 .pred_full_class_res_rf_1_07 rand_forest 0.396 full
4 .pred_full_class_res_rf_1_01 rand_forest 0.0544 full
5 .pred_full_class_res_rf_1_06 rand_forest 0.0155 full
6 .pred_full_class_res_rf_1_04 rand_forest 0.00356 full
Message

Members have not yet been fitted with `fit_members()`.
Expand All @@ -88,18 +88,17 @@
Message
-- A stacked ensemble model -------------------------------------

Out of 10 possible candidate members, the ensemble retained 3.
Penalty: 1e-05.
Out of 10 possible candidate members, the ensemble retained 2.
Penalty: 0.01.
Mixture: 1.

The 3 highest weighted member classes are:
The 2 highest weighted member classes are:
Output
# A tibble: 3 x 3
member type weight
<chr> <chr> <dbl>
1 .pred_yes_log_res_rf_1_05 rand_forest 3.56
2 .pred_yes_log_res_rf_1_02 rand_forest 3.23
3 .pred_yes_log_res_rf_1_09 rand_forest 0.215
# A tibble: 2 x 3
member type weight
<chr> <chr> <dbl>
1 .pred_no_log_res_rf_1_02 rand_forest 3.75
2 .pred_no_log_res_rf_1_05 rand_forest 2.70
Message

Members have not yet been fitted with `fit_members()`.
Expand All @@ -120,8 +119,8 @@
# A tibble: 2 x 3
member type weight
<chr> <chr> <dbl>
1 reg_res_svm_1_3 svm_rbf 1.26
2 reg_res_svm_1_2 svm_rbf 0.135
1 reg_res_svm_1_3 svm_rbf 1.18
2 reg_res_svm_1_2 svm_rbf 0.203

---

Expand All @@ -138,14 +137,14 @@
The 6 highest weighted member classes are:
Output
# A tibble: 6 x 4
member type weight class
<chr> <chr> <dbl> <fct>
1 .pred_full_class_res_rf_1_05 rand_forest 3.75 full
2 .pred_mid_class_res_rf_1_06 rand_forest 0.674 mid
3 .pred_full_class_res_rf_1_07 rand_forest 0.411 full
4 .pred_full_class_res_rf_1_01 rand_forest 0.0957 full
5 .pred_full_class_res_rf_1_06 rand_forest 0.0193 full
6 .pred_full_class_res_rf_1_04 rand_forest 0.0110 full
member type weight class
<chr> <chr> <dbl> <fct>
1 .pred_full_class_res_rf_1_05 rand_forest 3.81 full
2 .pred_mid_class_res_rf_1_06 rand_forest 0.674 mid
3 .pred_full_class_res_rf_1_07 rand_forest 0.396 full
4 .pred_full_class_res_rf_1_01 rand_forest 0.0544 full
5 .pred_full_class_res_rf_1_06 rand_forest 0.0155 full
6 .pred_full_class_res_rf_1_04 rand_forest 0.00356 full

---

Expand All @@ -154,16 +153,15 @@
Message
-- A stacked ensemble model -------------------------------------

Out of 10 possible candidate members, the ensemble retained 3.
Penalty: 1e-05.
Out of 10 possible candidate members, the ensemble retained 2.
Penalty: 0.01.
Mixture: 1.

The 3 highest weighted member classes are:
The 2 highest weighted member classes are:
Output
# A tibble: 3 x 3
member type weight
<chr> <chr> <dbl>
1 .pred_yes_log_res_rf_1_05 rand_forest 3.56
2 .pred_yes_log_res_rf_1_02 rand_forest 3.23
3 .pred_yes_log_res_rf_1_09 rand_forest 0.215
# A tibble: 2 x 3
member type weight
<chr> <chr> <dbl>
1 .pred_no_log_res_rf_1_02 rand_forest 3.75
2 .pred_no_log_res_rf_1_05 rand_forest 2.70

Binary file modified tests/testthat/helper_data.Rda
Binary file not shown.