Whats the most efficient way to convert a list of interactions such as this:
QWERT ASDF 12
QWERT ZXCV 15
QWERT HJKL 6
: : :
ASDF-XYZ HJKL-XYY 123
into an all vs all matrix representation such as this:
QWERT ASDF ZXCV ... ASDF-XYZ
QWERT 0 12 15 ... 9
ASDF 12 0 45 ... 35
ZXCV 15 45 0 ... 24
: : : : : :
ASDF-XYZ 9 35 24 ... 0
It could be a few thousand up to several hundred thousands of features, so speed does matter.
Edit: The input is a csv file. Please note that the feature names are arbitrary (but unique) strings and that missing interaction should be represented as 0 in the output matrix. Made the example more clear.