In Python I need to find the pairwise correlation between all features in a matrix A and all features in a matrix B. In particular, I am interestin
A
B
Adding on to the above answer from personal experience,
p1 = N*np.dot(B.T,A)
worked way faster for me when compared to
p1 = N*np.einsum('ij,ik->kj',A,B)
This was especially true when A and B are large dimensional matrices.