The data I'm woking with consists of 3 types of data:
1- binary features: those features are either 0 or 1. I have about 6 or 7 columns. 2- cells: the values here range from 0 to 0.8 at max. Here I have 38 columns. 3- genes: genes expression. I've picked 14 genes and added them. The values here are very much different from the rest, as they range from from to 400 and even more.
What I'm currently doing, is that I split the data to train and test before running the ML pipeline, and then I scale only the genes features. I scale the test set according to the train set. Like this:
gene_cols_train = grep("^gene_", names(train_set))
gene_cols_test = grep("^gene_", names(test_set))
scaled_gene_cols_train = scale(train_set[,gene_cols_train])
scaled_gene_cols_train = round(scaled_gene_cols_train*100)/100
train_set[,gene_cols_train] = scaled_gene_cols_train
scaled_gene_cols_test = scale(test_set[, gene_cols_test], center = attr(scaled_gene_cols_train, "scaled:center"),
scale = attr(scaled_gene_cols_train, "scaled:scale"))
scaled_gene_cols_test = round(scaled_gene_cols_test*100)/100
test_set[, gene_cols_test] = scaled_gene_cols_test
My question: is scaling only the genes a good approach? combining different data sources into one is kinda new to me, and I wonder how should I scale it sense the range of values differs so much between them.
thank you!