Skip to content Skip to sidebar Skip to footer

Sklearn Tsne With Sparse Matrix

I'm trying to display tsne on a very sparse matrix with precomputed distances values but I'm having trouble with it. It boils down to this: row = np.array([0, 2, 2, 0, 1, 2]) col =

Solution 1:

I think this should solve your problem:

X = csr_matrix((distances, (row, col)), shape=(3, 3)).todense()

If you really ment csr_matrix instead of csc_matrix

Post a Comment for "Sklearn Tsne With Sparse Matrix"