Answers.Body: <p>This should be possible, considering universal approximation theorem you should be able to build a ann that approximates features that gives the most likely best feature set for a different net to train on. I would us a rnn for with a softmax output layer that ranks features by performance.</p>
  
  <p>You can find a good explanation of softmax here: <a href="https://developers.google.com/machine-learning/crash-course/multi-class-neural-networks/softmax" rel="nofollow noreferrer">https://developers.google.com/machine-learning/crash-course/multi-class-neural-networks/softmax</a>
  basically it will assign probability values for each output node with all of these values adding up to 1.0 </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-13T05:03:45.107Z
Answers.Text: Could you please explain the procedure in a bit more detailed way or give some reference link?
Answers.UserDisplayName: GKozinski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-13T21:36:03.547Z
Answers.Text: I added a bit of info on softmax, what are you using for optimization? knowing that i may be able to provide a bit more insight into how i would set this up
Answers.UserDisplayName: nickw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-14T07:22:51.677Z
Answers.Text: Thanks for more info!
  I am using tensorflow library, mostly with Adam optimizer (trying others as well) with custom learning rate.
Answers.UserDisplayName: GKozinski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-20T14:17:06.173Z
Answers.Text: at a ten thousand foot level this could be done by deciding the amount of features or the min probability as a cut of and then creating a net with softmax output layer with a node for each feature, you will likely want to use a reinforcement learning optimization technique as you will need to evaluate if how well the features the net picks perform in order to optimize, you could use neuroevolution with a fitness function for this or i imagine other rl algos would work too.
Answers.UserDisplayName: nickw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-12T15:03:21.907Z
Answers.LastActivityDate: 2019-08-13T21:34:06.413Z
Answers.LastEditDate: 2019-08-13T21:34:06.413Z
Answers.UserDisplayName: nickw
Answers.Body: <p>There are multiple standard ways of feature selection, for example ranking features by information gain, that you could use, and then you can train the neural network on just those features.</p>
  <p>However, let's assume you have trained a neural network on all of the features and now want to estimate their importance. One approach you could take is to perform a sensitivity analysis on the inputs: add random noise in a controlled fashion to different features and see what effect it has. If the training dataset has been centered (so each feature has zero mean) then you could set the inputs to zero (the &quot;average&quot; training example) and then perturb each feature in turn to see what the effect is. You could also fix a feature permanently to zero and then run your validation data through the network and see how accuracy changes. There should be no major effect for insignificant features, but important features being zeroed should lead to a decrease in accuracy. You can also do something like this when predicting specific examples: perturb the example's features and see how much the prediction changes. <a href="https://github.com/marcotcr/lime" rel="nofollow noreferrer">LIME</a> does something like this to explain why a black box like a neural network makes the predictions it does.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-22T21:57:07.387Z
Answers.LastActivityDate: 2021-04-22T21:57:07.387Z
Answers.UserDisplayName: Mike NZ
Body: <p>I am wondering if I can use neural networks to find features importances in similar manner as it can be done for random forests or decision trees and if so, how to do it?</p>
  
  <p>I would like to use it on tabular time series data (not images). The reason why I want to find importances on neural networks not on decision trees is that NNs are more complicated algorithms so using NNs might point out some correlations that are not seen by simple algorithms and I need to know what features are found to be more useful with that complicated correlations.</p>
  
  <p>I am not sure if I made it clear enough, please let me know if I have to explain something more.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-08-12T11:16:46.017Z
Comments.Text: It's possible. I've used the `olden()` function from `NeuralNetTools`.
  Please take a look at this example found online:
  http://blogs2.datall-analyse.nl/2016/02/19/rcode_variable_importance_neural_network/
Comments.UserDisplayName: nba2020
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-01T17:11:12.800Z
Comments.Text: ofteт it is partially arguable that "NNs are more complicated algorithms so using NNs might point out some correlations that are not seen by simple algorithms", - though it  (NN) often can improve accuracy of prediction
Comments.UserDisplayName: JeeyCi
Tags: <neural-networks><feature-selection><feature-engineering>
Title: Can neural networks be used to find features importance?
UserDisplayName: GKozinski
ThreadText: # Can neural networks be used to find features importance?
  
  (Asked by: username_0 on 2019-08-08)
  
  I am wondering if I can use neural networks to find features importances in similar manner as it can be done for random forests or decision trees and if so, how to do it?
  
  I would like to use it on tabular time series data (not images). The reason why I want to find importances on neural networks not on decision trees is that NNs are more complicated algorithms so using NNs might point out some correlations that are not seen by simple algorithms and I need to know what features are found to be more useful with that complicated correlations.
  
  I am not sure if I made it clear enough, please let me know if I have to explain something more.
  
  **Tags:** neural-networks, feature-selection, feature-engineering
  > **Comments:**
  > **username_1**: It's possible. I've used the `olden()` function from `NeuralNetTools`. Please take a look at this example found online: http://blogs2.datall-analyse.nl/2016/02/19/rcode_variable_importance_neural_network/  
  > **username_2**: ofteт it is partially arguable that "NNs are more complicated algorithms so using NNs might point out some correlations that are not seen by simple algorithms", - though it  (NN) often can improve accuracy of prediction  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2019-08-12. Score: 2
  
  This should be possible, considering universal approximation theorem you should be able to build a ann that approximates features that gives the most likely best feature set for a different net to train on. I would us a rnn for with a softmax output layer that ranks features by performance.
  
  You can find a good explanation of softmax here: <https://developers.google.com/machine-learning/crash-course/multi-class-neural-networks/softmax>
  basically it will assign probability values for each output node with all of these values adding up to 1.0
  
  > **Comments:**
  > **username_0**: Could you please explain the procedure in a bit more detailed way or give some reference link?  
  > **username_3**: I added a bit of info on softmax, what are you using for optimization? knowing that i may be able to provide a bit more insight into how i would set this up  
  > **username_0**: Thanks for more info! I am using tensorflow library, mostly with Adam optimizer (trying others as well) with custom learning rate.  
  > **username_3**: at a ten thousand foot level this could be done by deciding the amount of features or the min probability as a cut of and then creating a net with softmax output layer with a node for each feature, you will likely want to use a reinforcement learning optimization technique as you will need to evaluate if how well the features the net picks perform in order to optimize, you could use neuroevolution with a fitness function for this or i imagine other rl algos would work too.  
  
  ---
  
  ### Answer by username_4 on 2021-04-22. Score: 0
  
  There are multiple standard ways of feature selection, for example ranking features by information gain, that you could use, and then you can train the neural network on just those features.
  
  However, let's assume you have trained a neural network on all of the features and now want to estimate their importance. One approach you could take is to perform a sensitivity analysis on the inputs: add random noise in a controlled fashion to different features and see what effect it has. If the training dataset has been centered (so each feature has zero mean) then you could set the inputs to zero (the "average" training example) and then perturb each feature in turn to see what the effect is. You could also fix a feature permanently to zero and then run your validation data through the network and see how accuracy changes. There should be no major effect for insignificant features, but important features being zeroed should lead to a decrease in accuracy. You can also do something like this when predicting specific examples: perturb the example's features and see how much the prediction changes. [LIME](https://github.com/marcotcr/lime) does something like this to explain why a black box like a neural network makes the predictions it does.
  
  
  ---
  
  