# NOT RUN {
# example for dataset without missing values
data(leukemia72_2)
# class label must be factor
leukemia72_2[,ncol(leukemia72_2)]<-as.factor(leukemia72_2[,ncol(leukemia72_2)])
class.method="svm"
method="InformationGain"
disc<-"MDL"
cross.method<-"fold-crossval"
thr=0.1
thr.cons=0.05
attrs.nominal=numeric()
max.f=10
out=classifier.loop(leukemia72_2,classifiers=class.method,
feature.selection=method,disc.method=disc,
threshold=thr, threshold.consis=thr.cons,attrs.nominal=attrs.nominal,
no.feat=max.f,flag.feature=FALSE,method.cross=cross.method)
# example for dataset with missing values
# }
# NOT RUN {
data(leukemia_miss)
xdata=leukemia_miss
# class label must be factor
xdata[,ncol(xdata)]<-as.factor(xdata[,ncol(xdata)])
# nominal features must be factors
attrs.nominal=101
xdata[,attrs.nominal]<-as.factor(xdata[,attrs.nominal])
delThre=0.2
out=input_miss(xdata,"mean.value",attrs.nominal,delThre)
if(out$flag.miss)
{
xdata=out$data
}
class.method="svm"
method="InformationGain"
disc<-"MDL"
cross.method<-"fold-crossval"
thr=0.1
thr.cons=0.05
max.f=10
out=classifier.loop(xdata,classifiers=class.method,
feature.selection=method,disc.method=disc,
threshold=thr, threshold.consis=thr.cons,attrs.nominal=attrs.nominal,
no.feat=max.f,flag.feature=FALSE,method.cross=cross.method)
# }
Run the code above in your browser using DataLab