Created
January 6, 2020 07:20
-
-
Save santhalakshminarayana/854b8dc5eb30e46dd2487384133683d7 to your computer and use it in GitHub Desktop.
Quotes TSNE - Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tsne = TSNE(n_components=2, perplexity=40, n_iter=300,metric='cosine') | |
n_points = 100 | |
emb_tsne = tsne.fit_transform(emb[:n_points, :]) | |
labels = list(word_to_int.keys())[:n_points] | |
x = emb_tsne[:,0] | |
y = emb_tsne[:,1] | |
plt.figure(figsize=(16, 16)) | |
for i in range(n_points): | |
plt.scatter(x[i],y[i]) | |
plt.annotate(labels[i], xy=(x[i], y[i]), xytext=(5, 2), | |
textcoords='offset points', ha='right', va='bottom') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment