I've spended lots of time trying but somehow nothing works - and I guess this is easy for advanced R users. I got an Dataformat where each element occurs linewise. First the label as an String followed by 1000 numeric features, all splited with whitespace:
"label1" 1 0 1 0 0 0 ...
"label2" 0 0 0 0 1 0 ...
"label2" 0 0 1 0 1 0 ...
"label2" 1 1 1 1 0 0 ...
...
The problem I have are the labels when reading the matrix (first row or always first column). I want to apply this matrix to tsne (dimension reduction) but the label cause problems. So I need the matrix without the labels but I'd like to store the labels later, so I can print them with their new dimensions. What I got so far is the following (rather pseudocode):
Data <- read.table("File.txt", header=False, row.names=1)
Labels <- Data[1] # I somehow need the labels
Data[1] <- NULL # this should remove the first row (labels ?)
tsne = tsne(Data, initial_config = NULL, k = 2, initial_dims = 30,...)# function that reduces dimension
Here I need something that prints the new 2-Dimensional matrix togehter with each label,
such as label[x] + tsne[xDimension] + tsne[yDimension]
I hope someone of you could help me, thanks in advance and best regards.
What you do with labels afterwards is completely up to you as it is not clear from your question what you want to achive with those