I want to brainstorm an idea in MATLAB with you guys. Given a matrix with many columns (14K) and few rows (7) where columns are items and rows features of the items, I would like to compute the similarity with all items and keep it in matrix which is:
- Easy to compute
- Easy to access
for 1., I came up with a brilliant idea of using pdist()
which is very fast:
A % my matrix
S = pdist(A') % computes the similarity btw all columns very fast
However accessing s
is not convenient. I prefer to access similarity between item i
and j
, e.g. using S(i,j)
:
S(4,5) % is the similarity between item 4 and 5
In its original definition, S
is an array not a matrix. Is making it as an 2D matrix a bad idea storage-wise? Could we think about a cool idea that can help me find which similaity corresponds to which items quickly?
Thank you.