if (require("tidymodels")) {
-
# The below approach formed the basis for this paper: DOI 10.3389/fmicb.2025.1582703
# Presence of ESBL genes was predicted based on raw MIC values.
@@ -146,13 +145,10 @@ may affect the computations for subsequent operations.
# Create and prep a recipe with MIC log2 transformation
mic_recipe <- recipe(esbl ~ ., data = training_data) %>%
-
# Optionally remove non-predictive variables
remove_role(genus, old_role = "predictor") %>%
-
# Apply the log2 transformation to all MIC predictors
step_mic_log2(all_mic_predictors()) %>%
-
# And apply the preparation steps
prep()
@@ -173,13 +169,15 @@ may affect the computations for subsequent operations.
bind_cols(out_testing)
# Evaluate predictions using standard classification metrics
- our_metrics <- metric_set(accuracy,
- recall,
- precision,
- sensitivity,
- specificity,
- ppv,
- npv)
+ our_metrics <- metric_set(
+ accuracy,
+ recall,
+ precision,
+ sensitivity,
+ specificity,
+ ppv,
+ npv
+ )
metrics <- our_metrics(predictions, truth = esbl, estimate = .pred_class)
# Show performance
diff --git a/reference/amr-tidymodels.md b/reference/amr-tidymodels.md
index f596839ef..bbf78daf5 100644
--- a/reference/amr-tidymodels.md
+++ b/reference/amr-tidymodels.md
@@ -106,7 +106,6 @@ preparing data for modelling, especially with classification models.
``` r
if (require("tidymodels")) {
-
# The below approach formed the basis for this paper: DOI 10.3389/fmicb.2025.1582703
# Presence of ESBL genes was predicted based on raw MIC values.
@@ -125,13 +124,10 @@ if (require("tidymodels")) {
# Create and prep a recipe with MIC log2 transformation
mic_recipe <- recipe(esbl ~ ., data = training_data) %>%
-
# Optionally remove non-predictive variables
remove_role(genus, old_role = "predictor") %>%
-
# Apply the log2 transformation to all MIC predictors
step_mic_log2(all_mic_predictors()) %>%
-
# And apply the preparation steps
prep()
@@ -152,13 +148,15 @@ if (require("tidymodels")) {
bind_cols(out_testing)
# Evaluate predictions using standard classification metrics
- our_metrics <- metric_set(accuracy,
- recall,
- precision,
- sensitivity,
- specificity,
- ppv,
- npv)
+ our_metrics <- metric_set(
+ accuracy,
+ recall,
+ precision,
+ sensitivity,
+ specificity,
+ ppv,
+ npv
+ )
metrics <- our_metrics(predictions, truth = esbl, estimate = .pred_class)
# Show performance
diff --git a/reference/amr_course.html b/reference/amr_course.html
index 8aa79e69a..5729a67bb 100644
--- a/reference/amr_course.html
+++ b/reference/amr_course.html
@@ -7,7 +7,7 @@
AMR (for R)
- 3.0.1.9045
+ 3.0.1.9047