selectedFeatures: Accessors for the 'selectedFeatures' slot.

Description Usage Arguments Value Note See Also Examples

Description

This slot, if not NULL, stores the selected features/variables for sparse model.

Usage

1
2
3
4
5
## S4 method for signature 'nblda'
selectedFeatures(object)

## S4 method for signature 'nblda_trained'
selectedFeatures(object)

Arguments

object

an nblda or nblda_trained object.

Value

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.

Note

If return.selected.features = FALSE within nbldaControl or all features/variables are selected and used in discrimination function, idx and names are returned NULL.

See Also

trainNBLDA, nblda, nblda_trained

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

NBLDA documentation built on May 2, 2019, 12:21 p.m.