0
$\begingroup$

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:

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

The output is:

            Overall
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.

$\endgroup$
  • $\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
0
$\begingroup$

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

$\endgroup$

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.