from sklearn.manifold import TSNE tsne = TSNE(n_components=2, perplexity=30) tsne_results = tsne.fit_transform(data)