randomForest_RFE | R Documentation |
Feature Selection Using Random Forest Classifier and Recursive Feature Elimination
randomForest_RFE(
datasets = list(),
label.col = 1,
positive.class = NULL,
featureNum.range = NULL,
folds.num = 10,
ntree = 1500,
seed = 1,
parallel.cores = 2,
...
)
datasets |
should be a list containing one or several input datasets. See examples. |
label.col |
an integer. The number of label column. |
positive.class |
|
featureNum.range |
is the range of feature number in each RFE iteration.
For example, if the original feature set has 100 features and |
folds.num |
an integer. Number of folds. Default |
ntree |
parameter for random forest. Default: 1500. See |
seed |
random seed for data splitting. Integer. |
parallel.cores |
an integer specifying the number of cores for parallel computation. Default: |
... |
other parameters passed to |
The function returns a list containing importance scores and relevant performance of the features.
randomForest_CV
, randomForest_tune
, randomForest
# Following codes only show how to use this function
# and cannot reflect the genuine performance of tools or classifiers.
data(demoPositiveSeq)
data(demoNegativeSeq)
RNA.positive <- demoPositiveSeq$RNA.positive
Pro.positive <- demoPositiveSeq$Pro.positive
RNA.negative <- demoNegativeSeq$RNA.negative
Pro.negative <- demoNegativeSeq$Pro.negative
dataPositive <- featureFreq(seqRNA = RNA.positive, seqPro = Pro.positive,
label = "Interact", featureMode = "conc",
computePro = "DeNovo", k.Pro = 3, k.RNA = 2,
normalize = "none", parallel.cores = 2)
dataNegative <- featureFreq(seqRNA = RNA.negative, seqPro = Pro.negative,
label = "Non.Interact", featureMode = "conc",
computePro = "DeNovo", k.Pro = 3, k.RNA = 2,
normalize = "none", parallel.cores = 2)
dataset <- rbind(dataPositive, dataNegative)
Perf_RFE <- randomForest_RFE(datasets = list(dataset), label.col = 1,
positive.class = "Interact",
featureNum.range = c(20, 50, 100),
folds.num = 5, ntree = 50, seed = 123,
parallel.cores = 2, mtry = 20)
# if you have more than one input dataset,
# use "datasets = list(dataset1, dataset2, dataset3)".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.