Reputation: 2850
I am trying to do a cluster plot from the t-SNE output using seaborn scatterplot. Below code
tsne_cluster = TSNE(perplexity=40, n_components=2, init='pca', n_iter=2500, random_state=23)
new_values_cluster = tsne_cluster.fit_transform(EMBEDDING_LIST)
sns.scatterplot(new_values_cluster[:,0], new_values_cluster[:,1], hue=y, legend='full', palette=palette)
When I run this, I get error ValueError: arrays must all be same length
I checked the length of new_values_cluster[:,0]
and new_values_cluster[:,1]
and they both are 200 (same size). So why am I getting this error?
Please suggest.
Upvotes: 0
Views: 865
Reputation: 1151
Check the hue=y
, I guess it's will never be the same shape as new_values_cluster
.
Upvotes: 1