

# 20 is the number of variable, -20 mean remove the variable number 20, so still 19
# read.csv2 = if the csv file separatd by ; the fraction number should be separeated by ,
# read.csv = if the csv file separatd by , the fraction number should be separeated by .


 library(rminer)
 library(MASS)
 x1=read.csv2('file:///C:/Users/khalid.alkharabsheh/Desktop/maindataset.csv')
 #x1<-x1[1:300,]
 input=colnames(x1[,-16]);n1=15
 names(x1)
 #---------------------------
 M=fit(GodClass~.,x1,model="rpart",task="cla")
 I=Importance(M,x1[,-16],method="CSA")
 cat("importances using MLP:\n")
 imp=round(I$imp,digits=5)
 for (i in 1:n1) {
 cat(sprintf("%s: %f\n",input[i],imp[i])) }
 L=list(runs=1,sen=t(I$imp),sresponses=I$sresponses)
 mgraph(L,graph="IMP",leg=names(x1),col="gray",Grid=10)
 # postscript('aaa.jpeg')
 # dev.off()
