how to get attribute importance in a dataset in r? I have a data set with almost 1/5th of data is NA. Out of all the columns, few are categorical and rest are numerical.My target variable is categorical variable. I want to find the most important attributes to build models. I would like to add that there is class biasness in few attributes. 
Can you please suggest any feasible solution to this problem.
My sample dataset looks like this  
a<-c("yes","yes","yes","yes","no",NA,"no")  
b<-c("yes","yes",NA,NA,"no",NA,"no")  
c<-c(15,40,34,24,NA,NA,10)  
d<-c("experienced","fresher","experienced","fresher",NA,"fresher","experienced")  
e<-("qualified","qualified","qualified",NA,"qualified",NA,"disqualified")  
f<-(NA,NA,NA,NA,NA,1,NA)  
g<-(1,0,1,1,0,1,1)
data<-data.frame(cbind(a,b,c,d,e,f,g))

please help.Is there any model that works well on data with more NA. How can bias be handled? How to find attribute importance? here the target variable is column "g".  
 A: Attribute importance can be found in several ways. Personally I prefer gain.ratio  In your case it will look like:
library('FSelector')
res <- gain.ratio(g~., data)

Here is result:
 attr_importance
a      0.08255015
b      0.18738364
c      0.22898040
d      0.32410280
e      0.21155751
f      0.12846603

From result it seems that d feature has strongest predictive power from all the features while a is weakest.
From the same package you can try cfs method as well. 
res <- cfs(g~., data)

But it gives just a  character vector containing chosen attributes:
[1] "c" "d"

Also you can check chi.squared
res <- chi.squared(g~., data)

Which model to use for you classification task is hard to tell. The No Free Lunch theorem for machine learning states that there is no one model that works best for every problem. You will have to try different models and see which one is best. 
I suggest you start with caret package and try few of many classifications supported.  Here's one interesting document which can give you suggestion about which classification algorithms to focus on:  Do we Need Hundreds of Classifiers to Solve Real World
Classification Problems?
A: There are many ways to get variable importance, so it really depends how you define it and how strict you are. Do you just want to create the best possible model, or get an importance metric for each one of your variables?
You can find lots of models that gives you an importance metric. Like: http://www.inside-r.org/packages/cran/randomForest/docs/importance , http://www.inside-r.org/packages/cran/caret/docs/varImp. You can find importance metrics using the rpart package (tree models) and the command info.gain.rpart(). You might use standardised coefficients from a linear regression model.
Those approaches are very likely to give you (slightly) different results, so it's wiser to chose a method that best fits your data. You need to experiment in order to pick the best model and also pick a threshold when you say "most important variables". Does that mean top 5, top 10, or something else?
In terms of NAs, think again if NA means missing value, or if it is something meaningful that you can replace with a number or a class/categorical value. I'm afraid that variables with lots of NAs will "lose" in terms of importance. 
