Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

visualising data with tsne

# Import TSNE
from sklearn.manifold import TSNE

# Create a TSNE instance: model
model = TSNE(learning_rate=200)

# Apply fit_transform to samples: tsne_features
tsne_features = model.fit_transform(samples)

# Select the 0th feature: xs
xs = tsne_features[:,0]

# Select the 1st feature: ys
ys = tsne_features[:,1]

# Scatter plot, coloring by variety_numbers
plt.scatter(xs, ys, c=variety_numbers)
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: dimension reduction using pca 
Python :: python project structure 
Python :: NMF cosine similarities 
Python :: bagging algorithm 
Python :: Normalize basic list data 
Python :: raspian image with preinstalled python3 
Python :: HIDING AND ENCRYPTING USING BASE24 MODULE 
Python :: sanic ip whitelist 
Python :: how to count the repeatance of every string in a list python 
Python :: a Python Numbers 
Python :: mystring = "hello" myfloat=float 10 myint=20 
Python :: negate all elements of a list 
Python :: update value in xml python 
Python :: how to unpack the whole list without index them individually python 
Python :: Open AI Call 
Python :: def print_seconds(hours minutes seconds) print() print_seconds(1 2 3) 
Python :: pandas fast way to view distribution by group 
Python :: antal riksdagsledamöter 
Python :: change the surface color rhinopython 
Python :: shutil cut poython 
Python :: how to stop gambling 
Python :: funzione generatore python 
Python :: import math print(m.cos(10)) 
Python :: how to get the words inside a entry tkinter python 
Python :: numpy slice double colon stack overflow 
Python :: python creare una list comprehension 
Python :: radice n esima python 
Python :: tkinter e.delete(0,END) 
Python :: qlcdnumber set value python 
Python :: how to make a dashboard with data representation using python free dash 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =