Skip to content

Instantly share code, notes, and snippets.

Created Jun 16, 2021
What would you like to do?
from sklearn.manifold import TSNE
import as px
df =
features = df.loc[:, :'petal_width']
tsne = TSNE(n_components=2, perplexity=20, random_state=1000)
projections = tsne.fit_transform(features)
fig = px.scatter(
projections, x=0, y=1,
color=df.species, labels={'color': 'species'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment