Yunfan-Li / Contrastive-Clustering

Code for the paper "Contrastive Clustering" (AAAI 2021)
MIT License
289 stars 92 forks source link

Could you please offer your code of t-SNE? #23

Closed zbw0329 closed 2 years ago

zbw0329 commented 2 years ago

Hi,thanks for your excellent CC. I want to visualize the clustering result,could you please release your code of t-SNE?

Yunfan-Li commented 2 years ago

Hi, you may refer to the previous issue #14. And here is a simple example of t-SNE plot. def tSNE(X, Y): from sklearn.manifold import TSNE X_embedded = TSNE(n_components=2).fit_transform(X) plt.figure() plt.scatter(X_embedded[:, 0], X_embedded[:, 1], c=Y) plt.savefig("./tSNE.png") plt.close() For other color choices, you could take a look at matplotlib.colors.

zbw0329 commented 2 years ago

Thanks for your help!