Returns the top features that an ML model found to be important for predicting the AMR phenotype of a given pathogen.
extractTopFeats(fit, prop_vi_top_feats = c(0, 1), n_top_feats = NA)Best model fit, such as the output of fitBestModel()
pillar::num A vector of length 2 with elements together
indicating the proportion of total variable importance the top features
should comprise. To get the features that contribute to the top 10 to 20% of
total variable importance, for example, set
prop_vi_top_feats = c(0.1, 0.2).
Returns all features by default.
pillar::num Number of top features to extract
A tibble with a column for top features (Variable), a column for
Importance, and a column for Sign (or, for multi-class, a tibble with
per-class columns of importance scores for each Variable)