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
# Importing Modules | |
from sklearn import datasets | |
from sklearn.manifold import TSNE | |
import matplotlib.pyplot as plt | |
# Loading dataset | |
iris_df = datasets.load_iris() | |
# Defining Model | |
model = TSNE(learning_rate=100) | |
# Fitting Model | |
transformed = model.fit_transform(iris_df.data) | |
# Plotting 2d t-Sne | |
x_axis = transformed[:, 0] | |
y_axis = transformed[:, 1] | |
plt.scatter(x_axis, y_axis, c=iris_df.target) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment