# Should we do Feature selection in parallel with feature engineering?

I'm working with LightGBM on a large data set about 3M row and about 8 columns. When i started feature generation after every new feature i was measuring the RMSE of the model and if it was the same or slightly worse i was removing it so is that procedure right ? or i should do all the feature generation and then apply feature selection on them and why ?

## 1 Answer

You can add features as you create them and check if the scoring improves (and by how much). Always measure the score on test data so you can detect overfitting.

When you are done with feature engineering you can perform feature selection to reduce the number of features or understand their importances in the model.

• but if added a feature and saw that its importance is higher than a lot of base features however, it increased the RMSE from 0.85 to 0.86 should i remove it or keep it ? – Mohy Mohamed May 12 '20 at 15:15
• You should probably keep it (because of high importance) and remove another one. Here the score goes down, probably because of overfitting. – Rusoiba May 12 '20 at 18:03
• okay thanks a lot – Mohy Mohamed May 13 '20 at 0:57