import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.manifold import TSNE


iris = load_iris()
iris_pd=pd.DataFrame(data=np.c_[iris['data']], columns=iris['feature_names'])
data = iris_pd[['petal length (cm)', 'petal width (cm)', 'sepal length (cm)']].to_numpy()

data_embedded = TSNE(n_components=2, learning_rate='auto', init='random', perplexity=3).fit_transform(data)
print(data_embedded)

plt.scatter(data_embedded[:, 0], data_embedded[:, 1])
plt.title('Visualization using t-SNE')


plt.show()