I'm currently dealing with large DNA sequences for machine learning purposes, I'm basically improving existing methods.

What I have is several millions of DNA sequences : ACGTAGGCAGGCTTTC ...

In the methods I'm currently reviewing they extracts the features like this : for every nucleobase they put 4 features, the first corresponding to A, the second to C, the third to G and the last to T. If for exemple the current base is G the corresponding 4 features will be 0 0 1 0.

The problem I have with that is that it multiply the number of "effective" feature by four and it will be very sparse.

I was wondering if there would be any disadvantages to put one feature per nucleobase which would be 0, 1, 2, 3 depending on the letter.

It is applied to DNA but my question extend to every kind of discrete features.


The clear disadvantage is that in the 0..4 encoding, the nucleotides corresponding to closer numbers will appear to be more similar, which is not necessarily true. E.g. if A=1, C=2, G=3 and T=4, then sequences AAAA and CCCC will be more similar than sequences AAAA and TTTT.

However, there is no necessity for four dimensions -- three dimensions are sufficient; you just use the coordinates of the vertices of a tetrahaedron:

A = (1,1,1)
C = (1,−1,−1)
G = (−1,1,−1)
T = (−1,−1,1)

In fact, this is not much different from dummy variable encoding. The reasons for chosing this path in variable encoding (rather than assigning a different number for each factor level) are the same as in the case above.

| cite | improve this answer | |

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.