I have a deep model and I want to figure out which feature has the maximum influence on predicted result. For this I train the model with all the features I think are important, during prediction I set all features =0 one by one keeping the rest unchanged so I could figure out which is the least important of all. On predicting the results of these tampered test set on the trained model I get the same(changes at 5th-6th decimal place) F1 score, Recall and Precision.

Can some one explain me where I am wrong?


This could mean that your features are heavily correlated. As a result, when you set one variable to 0, there is always another one that carries the same information. Try to set several features to 0 to see if you have the same issue. If yes, then it might be something else (maybe your code).

You might also be interested in this paper, you'll find several methods to assess feature importance.

  • $\begingroup$ I have changed a few features simultaneously as you suggested and my results have varied (on 2nd decimal place). Just one more thing, I just realized most of the entries in my dataset are already =0 and therefore the results don't vary as much as they should. What value shall I set my features to that signify removing it other than 0. Any idea? $\endgroup$ Jul 24 '19 at 1:42
  • 1
    $\begingroup$ What about adding random noise to the input (mean=0, std=feature's std)? $\endgroup$
    – Nakor
    Jul 24 '19 at 2:00
  • $\begingroup$ that appears a nice idea! I will try this. Another query, why you suggest (mean=0, std=feature's std)? $\endgroup$ Jul 24 '19 at 2:05
  • $\begingroup$ I wasnt sure if your features are normalized or have the same value range. If some of them vary between 0 and 1000 and others between 0 and 1, a random noise with variance 1 won't have the same effect on them. That's why I suggested a different noise variance depending on the feature. $\endgroup$
    – Nakor
    Jul 24 '19 at 2:08

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.