Skip to content

Instantly share code, notes, and snippets.

@abhijeet-talaulikar
Created August 31, 2023 13:38
Show Gist options
  • Save abhijeet-talaulikar/022560de00454f2d9ddfa02f83c96949 to your computer and use it in GitHub Desktop.
Save abhijeet-talaulikar/022560de00454f2d9ddfa02f83c96949 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import matplotlib
matrix = clean_data['ada_embedding'].to_list()
# Create a t-SNE model and transform the data
tsne = TSNE(n_components=2, perplexity=15, random_state=42, init='random', learning_rate=200)
vis_dims = tsne.fit_transform(matrix)
x = [x for x,y in vis_dims]
y = [y for x,y in vis_dims]
plt.figure(figsize=(20,10))
plt.scatter(x, y, alpha=0.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment