# Useful Representation of Continuous and Nominal variables

I want to develop a prediction model (e.g. using SVM, Neural Networks...etc) to predict the relationship between a protein and its DNA target. Each proteins is represented using ~100 continuous [-infinity,+infinity] numerical variables + one categorical (nominal) variable. However, its DNA target is a sequence of A,C,G and T letter and will be represented in also a categorical variable.

One feature vector should combine features (variables) from both of the protein and its target DNA sequence. So, I have to represent mixture of continuous and categorical (nominal) variables.

The categorical (nominal variables) are two types:

1) One type is to represent DNA Sequence (e.g. AACTT) [Note: we have four possibilities for DNA letters: A,C,G or T]

2) Another type is the category of the protein (I have 69 classes).

So, my questions are:

1) I am wondering what is the best representation for both types of categorical variables? (e.g. I saw people represent A,C,G and T as 0001,0010,0100 and 1000, respectively, while two binary digits were sufficient). What about the 69 classes variable?

2) Can I combine the continuous and categorical variables in one feature vector?

I have looked into similar questions in this group, but could not find relevant answer to what I have.

• To clarify, the DNA may be represented as {ATCGGATCAAGCTT....(20 such characters)} and protein as {1,38,-705,50,986,-5,7,-890,...(100 such numbers)}+{1 of 69 categories} ? And you want to combine and make a another entity which has one DNA and one protein? So the new entity will have 3 components?
– rnso
Mar 24, 2015 at 14:47
• correct @rnso!. (The DNA is of fixed length e.g. I selected it to be of length 20 letters) Mar 24, 2015 at 14:49
• Can you not have a smaller range for protein numbers rather than [-infinity,+infinity] ? What does it actually represent?
– rnso
Mar 24, 2015 at 14:52
• Initially you write that you want to "predict the relationship between a protein and its DNA target". Then you write that you want to combine them to a single vector. These 2 can be 2 different questions.
– rnso
Mar 24, 2015 at 14:54
• For your first question: actually some variables range between 0 and 1; some between -100, +200, some are more varient... (but none of the 100 variables have value <-10000 or >10000). These variables represent the chemical properties of the protein (e.g. its hydrophobic score..etc) Mar 24, 2015 at 14:56

To clarify, the DNA may be represented as {ATCGGATCAAGCTT....(20 such characters)} and protein as {1,38,-705,50,986,-5,7,-890,...(100 such numbers)}+{1 of 69 categories}. And you want to combine and make a another entity which has one DNA and one protein. So the new entity will have 3 components.

It seems that for protein part you want to show 101 features: 100 as numbers that represent the chemical properties of the protein (e.g. its hydrophobic score..etc) and last 1 as category (1 of 69 categories). It is like a table showing different features of different persons:

person_name height weight waist age gender family_name ...


So your can create a table with following columns:

DNA_sequence
Protein_name
Chemical_feature1
Chemical_feature2
Chemical_feature3
..
Protein_category_1_to_69


Then you can try to find which chemical feature or category is associated with which DNA sequence.

I believe DNA sequences can also be broken down to 'triplets'. That may also be helpful in finding associations.

I think you should break down your information into separate variables for better analysis. Each row of above table will be your combined entity.

Edit: To have analysis as described in the comment below, one can simply create a text string from 100 chemical features of proteins, eg:

"100,-52,-1,0.5,259,365,...."


This will then become one categorical variable (column) from 100 different numeric variables (columns). One can use 'paste' or 'paste0' function of R for this.

• Thanks for the description of the questions.However, I do not think this solution can work to solve the problem. Simply because what you said "Then you can try to find which chemical feature or category is associated with which DNA sequence" is not applicable here. We want the model to learn that when a protein with a specific values for the set of chemical properties (100 values) + one categorical value then it binds to this dna traget. It learns the same for each sample.So, consider the training data for the model as a matrix(rows=samples of proteins with their dna,columns=100+1+20 features) Mar 24, 2015 at 15:20