Description Usage Arguments Value Author(s) References See Also Examples
A grouped backward variable selection procedure.
1 2 3 | selectGroup(design, ydata, varNames, nvarGroup,
typeRF = ifelse(is.factor(ydata), "classif", "reg"),
verbose = TRUE, ntree = 500, ...)
|
design |
The design matrix. |
ydata |
The outcome data. Must be a factor for classification. |
varNames |
The vector of the group names. |
nvarGroup |
The vector of the number of variables in each group. |
typeRF |
The type of forest we want to construct, ‘classif’ for classification or ‘reg’ for regression. |
verbose |
Should the details be printed. |
ntree |
The number of trees in the forests (default: 500). |
... |
optional parameters to be passed to the ‘varImpGroup’ function. |
An object of class fRFE which is a list with the following components:
nselected |
The number of selected groups ; |
selection |
The selected groups ; |
selectionIndexes |
The indexes of selected groups in the input matrix ‘design’ ; |
error |
The prediction error computed in each iteration of the backward procedure ; |
typeRF |
The type of the forests, classification or regression ; |
ranking |
The final ranking of the groups ; |
rankingIndexes |
The final ranking indexes of the groups. |
Baptiste Gregorutti
Gregorutti, B., Michel, B. and Saint Pierre, P. (2015). Grouped variable importance with random forests and application to multiple functional data analysis, Computational Statistics and Data Analysis 90, 15-35.
selectLevel
,selectFunctional
,varImpGroup
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | cat("\n\nClassification\n")
data(toyClassif)
attach(toyClassif)
cat("Case 1\n")
nvarGroup <- c(2,1,6); names(nvarGroup) <- paste("G", 1:length(nvarGroup), sep="")
summary(varSel <- selectGroup(design=X, ydata=Y, nvarGroup=nvarGroup,
verbose=TRUE, ntree=500, normalize=FALSE))
plot(varSel)
cat("Case 2\n")
nvarGroup <- rep(1,9); names(nvarGroup) <- paste("G", 1:length(nvarGroup), sep="")
summary(varSel <- selectGroup(design=X, ydata=Y, nvarGroup=nvarGroup,
verbose=TRUE, ntree=500, normalize=FALSE))
plot(varSel)
detach(toyClassif)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.