Script to select the n best features for modeling a given dataset, using a recursive algorithm:
n
Initialize the set S of selected features to the full initial dataset
S
Initialize c as the current number of features in S
c
While c is greater than n:
Create random forest with features of S
Obtain importances from random forest
Remove from S the least important feature
If test-dataset is defined, evaluate the random forest
Update c with current number of features
Find more info in readme