Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2018 19:35
What would you like to do?
# 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(
# Plotting 2d t-Sne
x_axis = transformed[:, 0]
y_axis = transformed[:, 1]
plt.scatter(x_axis, y_axis,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment