0

I am working with the method randomForest for model building. And for a good model performance, it is very important to select the right features. At my example I have 30 variables and I would like to try to build different models with all possible combination with the given features, to choose at the and the best performed model. I am working with R and my question is if someone knows a method which could perform all feature combination as training data for model building thanks

hkn
  • 1

2 Answers2

1

This is an impossible task in any programming language.

You have 30 features. There are therefore $2^{30}$ possible combinations of features.

$2^{30} = 1,073,741,824$.

If you fit one model a second, you'll be done in $298,261.68$ hours, or about 34 years (give or take a few days due to leap years).

Therefore you need a different feature selection approach. And that question has been asked before: Feature selection with Random Forests

shadowtalker
  • 11,395
  • 3
  • 49
  • 109
0

I have tried recently Boruta algorithm. "It finds relevant features by comparing original attributes importance with importance achievable at random, estimated using their permuted copies". As a result algorithm separates input features on 3 classes: important, tentative and rejected.

Ivan T
  • 101
  • 1