import numpy as np from sklearn.manifold import TSNE X = np.array([[0, 0, 0, 2], [0, 1, 1, 3], [1, 0, 1, 4], [1, 1, 1, 5]]) X_embedded = TSNE(n_components=2, learning_rate='auto', init='random', perplexity=3).fit_transform(X) print(X_embedded.shape) print(X_embedded)
(4, 2) [[ 70.58453 59.78283 ] [-29.846848 -44.17736 ] [-31.542479 57.797546] [ 72.2927 -42.49625 ]]
Hosted onDeepnote