Randomly shuffles the AMR phenotype labels in the ML-ready tibble.
shuffleLabels(ml_input_tibble, seed = 5280)An ML-ready tibble generated by loadMLInputTibble().
This must have a target variable column named either
genome_drug.resistant_phenotype ("Resistant" or "Susceptible "
classification for one bug/drug combination) or resistant_classes
(multi-class classification for determining the drug classes to which each
genome is resistant), but not both.
num For reproducible analysis
Pangenome with randomly shuffled AMR phenotype labels
ml <- tibble::tibble(
genome_id = paste0("g", 1:6),
genome_drug.resistant_phenotype = rep(c("Resistant", "Susceptible"), each = 3),
feat_a = c(1L, 0L, 1L, 0L, 1L, 0L)
)
shuffleLabels(ml, seed = 42)
#> Shuffling phenotype labels (for baseline models).
#> # A tibble: 6 × 3
#> genome_id genome_drug.resistant_phenotype feat_a
#> <chr> <chr> <int>
#> 1 g1 Resistant 1
#> 2 g2 Susceptible 0
#> 3 g3 Susceptible 1
#> 4 g4 Susceptible 0
#> 5 g5 Resistant 1
#> 6 g6 Resistant 0