Skip to content

Instantly share code, notes, and snippets.

@CrazyDaffodils
Created January 14, 2020 00:23
Show Gist options
  • Select an option

  • Save CrazyDaffodils/ae5d9d625b261e17eb96ede2c916ffc6 to your computer and use it in GitHub Desktop.

Select an option

Save CrazyDaffodils/ae5d9d625b261e17eb96ede2c916ffc6 to your computer and use it in GitHub Desktop.

Revisions

  1. CrazyDaffodils created this gist Jan 14, 2020.
    9 changes: 9 additions & 0 deletions UMAP
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    from umap import UMAP
    import seaborn as sns
    model = UMAP(n_neighbors = 40, min_dist = 0.4, n_components = 2)
    umap = model.fit_transform(X_std)
    umap_df = pd.DataFrame(data=umap, columns=['UMAP1','UMAP2']).join(labels)
    palette = sns.color_palette("muted", n_colors=5)
    sns.set_style("white")
    sns.scatterplot(x='UMAP1',y='UMAP2',hue='Class',data=umap_df, palette=palette, linewidth=0.2, s=30,
    alpha=1).set_title('UMAP')