Created
February 17, 2016 03:34
-
-
Save sthomp/54986190b1500e3ab9e9 to your computer and use it in GitHub Desktop.
t-SNE plot
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
def plot_tsne(X_input_pool3, Y_input,n=10000): | |
indicies = np.random.permutation(X_input_pool3.shape[0])[0:n] | |
Y=tsne(X_input_pool3[indicies]) | |
num_labels=Y_input[indicies] | |
labels=classes[num_labels] | |
df=pd.DataFrame(np.column_stack((Y,num_labels,labels)), columns=["x1","x2","y","y_label"]) | |
sns.lmplot("x1","x2",data=df.convert_objects(convert_numeric=True),hue="y_label",fit_reg=False,legend=True,palette="Set1") | |
print 'done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment