pavlin-policar / openTSNE

Extensible, parallel implementations of t-SNE
https://opentsne.rtfd.io
BSD 3-Clause "New" or "Revised" License
1.44k stars 158 forks source link

how to get embedding in np.array format #201

Closed morningphase closed 2 years ago

morningphase commented 2 years ago
I want to use: low_dim_embs = tsne.fit(np.array(emb_matrix))
Actual behaviour is getting the class :TSNEEmbedding
what can I do
dkobak commented 2 years ago

What about np.array(low_dim_embs)?

pavlin-policar commented 2 years ago

TSNEEmbedding is actually a subclass of np.ndarray, so you could treat it as such. If you want to get rid of the extra variables you can do np.array(low_dim_embs), as Dmitry has written, or you could do low_dim_embs.view(np.ndarray).