<p>R's nnet package only supports fully connected neural networks with one hidden layer. This is the most primitive type of network. I doubt it will work well for promotors finding. In addition, such network won't give you useful interpretations.</p>

<p>If you want to explore neural networks, you should use a one-dimension convolution layer as is described in <a href="http://www.nature.com/nbt/journal/v33/n8/full/nbt.3300.html" rel="noreferrer">this paper</a>. This layer effectively represents a positional weight matrix (PWM). You can know which motifs are used. With backtracking, you can also identify the coordinates of motifs. To deploy such a model, you need to be fairly familiar with deep learning and to learn one deep learning framework. For framework, you may start with <a href="https://keras.io" rel="noreferrer">keras</a>. Once you get used to keras, you can implement your full promotor finder in less than 100 lines of python code. Alternatively, you may try <a href="http://kundajelab.github.io/dragonn/" rel="noreferrer">dragonn</a>. It is supposed to simplify deploying models for DNA sequences. I have no experience with it, though.</p>

<p>For promotor finding, it is also worth trying traditional methods. It is interesting that few/no neuralNet-based publications have evaluated traditional methods, probably because many ML people know little about classical motif finding. These methods could work well, too.</p>

CC BY-SA 3.0
2017-06-10T14:14:17.493Z
2017-06-10T14:14:17.493Z
user172818
<p>Short answer: you can't.</p>

<p>Neural networks use positive and negative examples to add weights to the neural network architecture that is provided to it. Trying to deconvolve the meaning behind the weights is nigh-on impossible except for the simplest perceptron.</p>

<p>This is common to many machine learning algorithms: they work very much like black boxes. One exception is decision trees. They will report what features are used to classify the positive vs negative datasets.</p>

<p>However, as with all ML methods, you need to be very careful of your training datasets. This is especially true of motif searching and especially for negative datasets. It's quite easy to find a negative dataset which is completely inappropriate for learning and give you misleading accuracies.</p>

<p>Like @user172818, I would try traditional methods as they can work well, again, if given appropriate data. The <a href="http://meme-suite.org/" rel="nofollow noreferrer">MEME-suite</a> would be a good start.</p>

CC BY-SA 3.0
2017-07-11T20:45:38.807Z
You may have a look at the paper under a link in my answer. For CNN, the weights in the first convolutional layer is interpretable.
user172818
CC BY-SA 3.0
2017-08-18T08:40:05.820Z
Agree. Which is what I said about "the simplest perceptron".
ithinkiam
CC BY-SA 3.0
2017-07-11T15:01:38.167Z
2017-07-11T15:01:38.167Z
ithinkiam
<p>I used a script in R language that uses nnet library to predict promoter bacteria and i would like to know how to extract rules from this neural network results.</p>

<p>As my input of the neural network i have n positive examples of promoter and n false examples. I use as input these examples and the FASTA file with the genome of the bacteria. As a result, i have a value of 0 to 1 for each network tested corresponding to its learning. I want to discover roles that can improve my network in future experiments in the same bacteria.</p>

<p>Which algorithms or softwares could i use?</p>

CC BY-SA 3.0
2017-06-10T11:21:22.493Z
Welcome to Bioinformatics! Could you post an example? What kind of rules do you expect? What have you found/tried (to avoid proposing things you already did/search) ?
llrs
CC BY-SA 3.0
2017-06-10T11:33:53.657Z
Please [edit] it into the question. What have you looked for to solve your problem?
llrs
CC BY-SA 3.0
2017-06-10T11:39:27.623Z
I am starting to search for possible solutions to rule extraction.
Rafael Coelho
CC BY-SA 3.0
2017-06-10T14:13:01.007Z
That would be the first thing before other people start to freely invest their time
llrs
<r><fasta><machine-learning>
Rule Extraction from nnet results
# Rule Extraction from nnet results

(Asked by: username_0 on 2017-06-10)

I used a script in R language that uses nnet library to predict promoter bacteria and i would like to know how to extract rules from this neural network results.

As my input of the neural network i have n positive examples of promoter and n false examples. I use as input these examples and the FASTA file with the genome of the bacteria. As a result, i have a value of 0 to 1 for each network tested corresponding to its learning. I want to discover roles that can improve my network in future experiments in the same bacteria.

Which algorithms or softwares could i use?

**Tags:** r, fasta, machine-learning
> **Comments:**
> **username_1**: Welcome to Bioinformatics! Could you post an example? What kind of rules do you expect? What have you found/tried (to avoid proposing things you already did/search) ?  
> **username_1**: Please [edit] it into the question. What have you looked for to solve your problem?  
> **username_0**: I am starting to search for possible solutions to rule extraction.  
> **username_1**: That would be the first thing before other people start to freely invest their time  

---

## 2 answers

### Answer by username_3 on 2017-07-11. Score: 4 | Accepted answer

Short answer: you can't.

Neural networks use positive and negative examples to add weights to the neural network architecture that is provided to it. Trying to deconvolve the meaning behind the weights is nigh-on impossible except for the simplest perceptron.

This is common to many machine learning algorithms: they work very much like black boxes. One exception is decision trees. They will report what features are used to classify the positive vs negative datasets.

However, as with all ML methods, you need to be very careful of your training datasets. This is especially true of motif searching and especially for negative datasets. It's quite easy to find a negative dataset which is completely inappropriate for learning and give you misleading accuracies.

Like @user172818, I would try traditional methods as they can work well, again, if given appropriate data. The [MEME-suite](http://meme-suite.org/) would be a good start.

> **Comments:**
> **username_2**: You may have a look at the paper under a link in my answer. For CNN, the weights in the first convolutional layer is interpretable.  
> **username_3**: Agree. Which is what I said about "the simplest perceptron".  

---

### Answer by username_2 on 2017-06-10. Score: 7

R's nnet package only supports fully connected neural networks with one hidden layer. This is the most primitive type of network. I doubt it will work well for promotors finding. In addition, such network won't give you useful interpretations.

If you want to explore neural networks, you should use a one-dimension convolution layer as is described in [this paper](http://www.nature.com/nbt/journal/v33/n8/full/nbt.3300.html). This layer effectively represents a positional weight matrix (PWM). You can know which motifs are used. With backtracking, you can also identify the coordinates of motifs. To deploy such a model, you need to be fairly familiar with deep learning and to learn one deep learning framework. For framework, you may start with [keras](https://keras.io). Once you get used to keras, you can implement your full promotor finder in less than 100 lines of python code. Alternatively, you may try [dragonn](http://kundajelab.github.io/dragonn/). It is supposed to simplify deploying models for DNA sequences. I have no experience with it, though.

For promotor finding, it is also worth trying traditional methods. It is interesting that few/no neuralNet-based publications have evaluated traditional methods, probably because many ML people know little about classical motif finding. These methods could work well, too.


---

