Skip to content

Instantly share code, notes, and snippets.

@santhalakshminarayana
Created January 6, 2020 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save santhalakshminarayana/854b8dc5eb30e46dd2487384133683d7 to your computer and use it in GitHub Desktop.
Save santhalakshminarayana/854b8dc5eb30e46dd2487384133683d7 to your computer and use it in GitHub Desktop.
Quotes TSNE - Medium
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