Created
July 7, 2019 15:09
-
-
Save peakBreaker/d86a2b3da5786533a77dc690cee3dd68 to your computer and use it in GitHub Desktop.
Running TSNE
This file contains hidden or 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
# Import TSNE | |
from sklearn.manifold import TSNE | |
def run_tsne(samples): | |
# Create a TSNE instance: model | |
model = TSNE(learning_rate=200) | |
# Apply fit_transform to samples: tsne_features | |
tsne_features = model.fit_transform(samples) | |
# Select the 0th feature: xs | |
xs = tsne_features[:,0] | |
# Select the 1st feature: ys | |
ys = tsne_features[:,1] | |
# Scatter plot, coloring by variety_numbers | |
# plt.scatter(xs,ys,c=labels) | |
# plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment