# Is it correct to transform SNP data (categorical) to numeric (0, 1, 2) format to apply ML algorithms later? Why not binary (0, 1) data?

I wanted to know why is it correct to transform SNP data to 0, 1, 2 format using a reference allele, for example: SNP1 with C/T alleles, transformation rules: CC = 2, CT = 1, TT = 0, to later apply machine learning algorithms for predict a specific trait?

I ask this because giving this ordinal values to SNP data may affect greatly the result of a classification model, since in a way, we are giving "more importance" to diploid "CC" with a bigger value of 2, than to diploid TT with a value 0.

Wouldn't it be better to transform the data into a binary format, where each SNP feature will be transformed to 16 possible combinations of ACGT alleles? The resulting dataset would be transformed so that each SNP will be represented by 16 columns with 0/1 values.

E.g. if you use a linear model, $y=x'\beta$ then quantitative coding implies that, when we switch from TT to CT the response changes by exactly the same amount as when we switch from CT to CC, which doesn't make much sense. I agree that you should code it as a categorical factor with 16 or so levels.