efficient way of constructing a matrix of pair-wise distances between many vectors?
问题 First, thanks for reading and taking the time to respond. Second, the question: I have a PxN matrix X where P is in the order of 10^6 and N is in the order of 10^3. So, X is relatively large and is not sparse. Let's say each row of X is an N-dimensional sample. I want to construct a PxP matrix of pairwise distances between these P samples. Let's also say I am interested in Hellinger distances. So far I am relying on sparse dok matrices: def hellinger_distance(X): P = X.shape[0] H1 = sp.sparse