Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

sklearn kmeans mnist

pca = PCA(n_components=n_digits)
X_pca = pca.fit(inputs).transform(inputs)

kmeans = KMeans(n_clusters=n_digits, init=pca.components_, n_init=1)
predict = kmeans.fit(inputs).predict(inputs)

stats = clusters_stats(predict, Y)
purity = clusters_purity(stats)

print("Plotting an extract of the 10 clusters, overall purity: %f" % purity)

#plot_clusters(predict, Y, stats)
print(pca.components_)
Comment

PREVIOUS NEXT
Code Example
Python :: Load Data From JSON PYQT5 
Python :: padnas get list of rows 
Python :: Python - Cómo cruda la cuerda 
Python :: using rlike in pyspark for numeric 
Python :: df filter by multiple rules python 
Python :: add hours to date time in python 
Python :: Convert this bash command into Python echo have a nice day Quizlet 
Python :: jpg image in tkinter title 
Python :: how to make celery create missing queue 
Python :: plot line2d on axis 
Python :: how to convert hash to string in python 
Python :: python indexing 
Python :: var person 
Python :: python bangla packages 
Python :: onetoone vs foreign key django 
Python :: python which packages depend on package 
Python :: kivy lang 
Python :: label default text value python 
Python :: read file python 
Python :: grepper how to use fraction 
Python :: colorama input python 
Python :: pydictionary 
Python :: how ti maek a prinyt comnad i pyuthon 
Python :: python lane angle detection 
Python :: python pipe select where 
Python :: max sum slice python 5 - autopilot 
Python :: py if else if 
Python :: convert c code to python code online 
Python :: download python for windows 7 32 bits 
Python :: get user id discord.py 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =