forwardSel: forwardSel

View source: R/featuresel.R

forwardSelR Documentation

forwardSel

Description

Wrapper feature selection based on forward selection and a generic predictor

Usage

forwardSel(
  X,
  Y,
  algo = "rf",
  nmax = 5,
  nmax2 = nmax,
  cv = 1,
  classi = FALSE,
  verbose = FALSE,
  ...
)

Arguments

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 cv=1 no cross-validation)

verbose:

if TRUE it prints out the selected variables and associated accuracy (MSE if regression and Misclassification error if classification)

Details

forwardSel

Wrapper feature selection based on forward selection and a generic predictor

Value

Indices of nmax top ranked features

Author(s)

Gianluca Bontempi Gianluca.Bontempi@ulb.be

References

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.

Examples

## 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)

gbonte/gbcode documentation built on Feb. 27, 2024, 7:38 a.m.