Ok, i'm not sure what this transformation is called, but here's what i want to do.
Given a matrix of categorical variables:
x = ['a', 'b'; 'a', 'c'; 'a', 'b'; 'b', 'c'; 'c', 'a'; 'a', 'd' ]
Generate a matrix that has all of the combination counts:
a b c d - - - -a | 0 2 1 1b | 0 0 1 0c | 1 0 0 0d | 0 0 0 0
Any thoughts?
Best Answer