z991
z991

Reputation: 713

Feature selection using tensorflow

I am using python 3.5 with tensorflow 0.11.

I have a dataset with large number of features (>5000) and relatively small number of samples(<200). I am using wrapper skflow function DNNClassifier for deep learning.

It seems to work work well for classification task, but I want to find some important features from large number of features.

Internally, DNNClassifier seems to perform feature selection(or feature extraction). Is there any way to perform feature selection with tensorflow?

Or, is there some function to extract the weights of the features? (There was a function DNNClassifier.weights_, but it seems to be deprecated)

If Tensorflow does not support feature selection or weight information, will it be reasonable to conduct feature selection using other method(such as univariate feature selection) and then try deep learning?

Thank you for help.

Upvotes: 0

Views: 2584

Answers (1)

JM Espez
JM Espez

Reputation: 38

You can eval the weights. For example if your variable is define by

weights = tf.Variable(np.ones([100,10],dtype='float32'), name=weights)

you can get it value at the tensorflow session

value = weights.eval();

Upvotes: 1

Related Questions