selectedFeatures | R Documentation |
This slot, if not NULL, stores the selected features/variables for sparse model.
## S4 method for signature 'nblda' selectedFeatures(object) ## S4 method for signature 'nblda_trained' selectedFeatures(object)
object |
an |
a list of selected features info including the followings:
idx |
column indices of selected features/variables |
names |
column names of selected features/variables if input data have pre-defined column names. |
If return.selected.features
= FALSE within nbldaControl
or all features/variables
are selected and used in discrimination function, idx
and names
are returned NULL.
trainNBLDA
, nblda
, nblda_trained
set.seed(2128) counts <- generateCountData(n = 20, p = 50, K = 2, param = 1, sdsignal = 0.5, DE = 0.6, allZero.rm = FALSE, tag.samples = TRUE) x <- t(counts$x + 1) y <- counts$y xte <- t(counts$xte + 1) ctrl <- nbldaControl(folds = 2, repeats = 2, return.selected.features = TRUE, transform = TRUE, phi.epsilon = 0.10) fit <- trainNBLDA(x = x, y = y, type = "mle", tuneLength = 10, metric = "accuracy", train.control = ctrl) selectedFeatures(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.