I'm working on a model to understand the predictors (variables) importance, and whether going forward I should include them in the model which should scale over > 1M rows. Here is a sample of my data:

type  | div      | predicted
med    standard    win 
med    express     loss
high   new         loss
low    standard    win

I've been using R (but I'm open to other tools such as Python), in which I created a model using just "type" for now, and used this command:

modelFit <- train(predicted~., data = train_data, method="rf")

The output is:

divstandard  100
typelow      100
typemed      50

However, I'm looking for what of the variables (either "div" or "type") are more relevant to predicting a "win" or "loss". Ideas on how to find the most important variable in terms of prediction?

I've also looked into using excel with this, in particular the CORREL function, but that doesn't seem to work well with non-numeric variables.

  • $\begingroup$ What function are you using to fit the model? $\endgroup$ – Sheep Oct 27 '15 at 19:14
  • $\begingroup$ @Sheep - caret package, modelfit function $\endgroup$ – jKraut Oct 27 '15 at 20:04
  • $\begingroup$ you only have those two categorical predictors, for over one million rows? how many levels do those variable have? you could use a linear model as well. $\endgroup$ – carlo Nov 9 '19 at 13:55

I see you are using random forests, so an alternative apporoach would be to try out the C.50 package. It yields a decision tree as well, it is pretty fast, and it gives you a variable improtance summary (which vars were used mostly for splitting the tree).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.