forwardSel | R Documentation |
Wrapper feature selection based on forward selection and a generic predictor
forwardSel(
X,
Y,
algo = "rf",
nmax = 5,
nmax2 = nmax,
cv = 1,
classi = FALSE,
verbose = FALSE,
...
)
X: |
input dataset |
Y: |
output dataset |
algo: |
see the options of pred. If more than one algorithm is mentioned, a blocking selection is carried out |
nmax: |
number of top returned features |
nmax2: |
number of forward selection steps |
classi: |
if TRUE, classification problem else regression |
back: |
if TRUE, backward reordering based on linear regression |
cv: |
number of cross-validation folds (if |
verbose: |
if TRUE it prints out the selected variables and associated accuracy (MSE if regression and Misclassification error if classification) |
forwardSel
Wrapper feature selection based on forward selection and a generic predictor
Indices of nmax
top ranked features
Gianluca Bontempi Gianluca.Bontempi@ulb.be
Handbook Statistical foundations of machine learning available in https://tinyurl.com/sfmlh. For blocking see Bontempi G. A blocking strategy to improve gene selection for classification of gene expression data. IEEE/ACM Trans Comput Biol Bioinform. 2007 Apr-Jun;4(2):293-300.
## regression example
N<-100
n<-5
neff<-3
R<-regrDataset(N,n,neff,0.1,seed=0)
X<-R$X
Y<-R$Y
real.features<-R$feat
ranked.features<-forwardSel(X,Y,nmax=3)
## classification example
N<-100
n<-5
neff<-3
R<-regrDataset(N,n,neff,0.1,seed=1)
X<-R$X
Y<-factor(R$Y>mean(R$Y))
## it creates a binary class output
real.features<-R$feat
ranked.features<-forwardSel(X,Y,nmax=3,classi=TRUE,cv=3)
## classification example with blocking
N<-100
n<-5
neff<-3
R<-regrDataset(N,n,neff,0.1,seed=1)
X<-R$X
Y<-factor(R$Y>mean(R$Y))
## it creates a binary class output
real.features<-R$feat
ranked.features<-forwardSel(algo=c("rf","lda"), X,Y,nmax=3,classi=TRUE,cv=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.