feat.rank.re | R Documentation |
Feature selection with resampling method.
feat.rank.re(x,y,method=,pars = valipars(),tr.idx=NULL,...)
x |
A matrix or data frame containing the explanatory variables. |
y |
A factor specifying the class for each observation. |
method |
Feature selection method to be used. For each method used in this
function, the output must be a list including two components, |
pars |
A list of resampling scheme method such as Leave-one-out cross-validation,
Cross-validation, Bootstrap and Randomised validation (holdout).
See |
tr.idx |
User defined index of training samples. Can be generated by |
... |
Additional parameters to |
A list with components:
method |
Feature selection method used. |
fs.rank |
A vector of final feature ranking list. |
fs.order |
A vector of final feature order from best to worst. |
rank.list |
Feature rank lists of all computation. |
order.list |
Feature order lists of all computation. |
pars |
Resampling parameters. |
tr.idx |
Index of training samples. |
all |
All results come from re-sampling. |
Wanchang Lin
valipars
, feat.freq
, frankvali
## prepare data set
data(abr1)
cls <- factor(abr1$fact$class)
dat <- abr1$pos
## dat <- abr1$pos[,110:1930]
## fill zeros with NAs
dat <- mv.zene(dat)
## missing values summary
mv <- mv.stats(dat, grp=cls)
## mv ## View the missing value pattern
## filter missing value variables
## dim(dat)
dat <- dat[,mv$mv.var < 0.15]
## dim(dat)
## fill NAs with mean
dat <- mv.fill(dat,method="mean")
## log transformation
dat <- preproc(dat, method="log10")
## select class "1" and "2" for feature ranking
ind <- which(cls==1 | cls==2)
x <- dat[ind,,drop=FALSE]
y <- cls[ind, drop=TRUE]
## feature selection
pars <- valipars(sampling="boot",niter=2,nreps=5)
tr.idx <- trainind(y,pars=pars)
z <- feat.rank.re(x,y,method="fs.auc",pars = pars)
names(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.