# How to deal with random state affecting feature selection? (gradient-boosted trees)

I'm dealing with an imbalanced classification problem and I'd like to use feature importance from gradient boosting decision trees for recursive feature elimination in order to get rid of redundant features (on every iteration, remove feature with lowest importance, and calculate the resulting validation performance). I was planning on training neural networks later with the reduced feature set. The problem is that whenever I change my "seed" number (random state) when training trees using lightGBM, the feature importance rankings can change even quite significantly! What is a good way of dealing with this? Should I e.g. use 10 different seed numbers, and average the results?

I am using early stopping with a fixed validation subset, not cross-validation. Because of this I was surprised to see the large impact of the seed number. It is also making my hyperparameter search results inconsistent if I do not fix the seed number. I have 30-40 features and some 10**6 samples.

• 1. Can you please give us some metrics of how much the rankings change? 2. 30-40 features are well within the capabilities of a standard NN, there is little reason to use feature selection before that. 3. Given that the data you are working with is rather manageable size-wise ($10^6 \times 40$ is by no mean a prohibiting sample size) I would suggest focusing on getting your GBM "as good as it gets" and turn your attention to NN afterwards. – usεr11852 Aug 25 '18 at 11:48
• They change quite a bit. I decided to use a large random forest (N=1000) for feature importance rankings instead, I assume they should be more robust compared to GBM, since each tree is built independently. I have experimented with removing highly correlated features, the impact on performance seems very modest. However, I am still interested in the feature importance scores for interpreting the data. – Peterukk Sep 16 '18 at 13:37