Advertisement
akashtadwai

TSNE-embedding

Jul 15th, 2021
1,068
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. tsne = TSNE(n_components=2, random_state=0,verbose=1,perplexity=50,init='pca')
  2. X_2d = tsne.fit_transform(X_t)
  3.  
  4. target_ids = [0,1]
  5. y_t=y_t.astype('int')
  6.  
  7. plt.figure(figsize=(10,6))
  8. colors = 'r', 'g'
  9. target_names=['Reject','Accept']
  10. for i, c, label in zip(target_ids, colors, target_names):
  11.     plt.scatter(X_2d[y_t[:,-1] == i,0], X_2d[y_t[:,-1] == i,1], c=c, label=label)
  12. plt.axis('off')
  13.  
  14. plt.legend()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement