-
-
Save amankharwal/e2f5228450e01623c6186084e9af7925 to your computer and use it in GitHub Desktop.
This file contains 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
from sklearn.manifold import TSNE | |
import plotly.express as px | |
df = px.data.iris() | |
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'} | |
) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment