How I know which gene is a good predictor in this neural network or not? I have 25 highly differentially expressed genes among and patients to chemotherapy.
I have made a neural network of these genes. The accuracy of the model is 0.73 but I don't know from 25 genes how I could select the best predictors or remove the weaker ones.
&gt; # Convert column from /to 1/0
&gt; = as.numeric(data$)-1
&gt; data1 = cbind(,df)

&gt; head(data1[,1:4])
   ALB CALML5 CALML6
A2       0 4.64   5.77   3.16
A3       0 7.12   9.13   5.13
A4       0 7.84   7.09   4.85
A6       0 7.90   9.64   6.52
A7       0 5.84   6.26   0.00
A8       0 4.83   5.77   2.15
&gt;
&gt; library(caTools)
&gt; set.seed(101)
&gt; # Create Split (any column is fine)
&gt; split = sample.split(data1$, SplitRatio = 0.70)
&gt; # Split based off of split Boolean Vector
&gt; train = subset(data1, split == TRUE)
&gt; test = subset(data1, split == FALSE)
&gt; feats &lt;- names(data[,-1])
&gt; # Concatenate strings
&gt; f &lt;- paste(feats,collapse=' + ')
&gt; f &lt;- paste('TG ~',f)
&gt; # Convert to formula
&gt; f &lt;- as.formula(f)
&gt; f
~ ALB + CALML5 + CALML6 + CDK6 + CHGA + CREB3L3 + CSF3 + 
    CXCL5 + CXCL6 + CXCL8 + DKK1 + EGLN2 + FGF20 + FGF4 + IL11 + 
    IL1B + IL6 + ISG15 + KLK5 + KRT17 + MMP3 + MMP7 + PKP1 + 
    PTGS2 + S100A7A
&gt; #install.packages('neuralnet')
&gt; library(neuralnet)
Warning message:
package ‘neuralnet’ was built under R version 3.5.2 
&gt; nn &lt;- neuralnet(f,train,hidden=c(25,2,1),linear.output=FALSE)
&gt; View(test)
&gt; # Compute Predictions off Test Set
&gt; predicted.nn.values &lt;- compute(nn,test[2:26])
&gt; # Check out net.result
&gt; print(head(predicted.nn.values$net.result))
             [,1]
A4  0.26890819169
B5  0.94836576493
B7  0.19753554824
B8  0.99790838807
B9  0.99764782073
B12 0.05230351043
&gt; predicted.nn.values$net.result &lt;- sapply(predicted.nn.values$net.result,round,digits=0)
&gt; table(test$Private,predicted.nn.values$net.result)
   
    0 1
  0 4 3
  1 1 7

&gt; accuracy&lt;-(table(test$Private,predicted.nn.values$net.result)[1,1]+table(test$Private,predicted.nn.values$net.result)[2,2])/(sum(table(test$Private,predicted.nn.values$net.result)))


&gt; accuracy
[1] 0.7333333333
&gt;
Yes, there is a formal solution. You want a heat map of the layers weighting and this is the information sought. It is more difficult to interpret than other supervised learning algorithms, but that is the nature of neural networks. 

I know Sci-test Learn (Python), but I don't know R for neural networks, so I can't advise you on the code, only that it will be a few lines of code and a graphical (relative) output. I imagine Tensorflow will have a really brilliant heat map layer weighting.