Co-occurrence matrix using SAC?
问题 I have the following data frame 'x' id,item,volume a,c1,2 a,c2,3 a,c3,2 a,c4,1 a,c5,4 b,c6,6 b,c1,2 b,c3,1 b,c2,6 b,c4,4 c,c2,5 c,c8,6 c,c9,2 d,c1,1 e,c3,7 e,c2,3 e,c1,2 e,c9,5 e,c4,1 f,c1,7 f,c3,1 The first column is the id of a customer, the second column is the id of an item that customer bought and the third column is the number of those items bought. I'm trying to create a co-occurrence matrix which is a square matrix with 8 rows and columns, 8 being the number of distinct items. n =