Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

visualising centroid of an unsupervised learning algorithm

# Assign the cluster centers: centroids
centroids = model.cluster_centers_

# Assign the columns of centroids: centroids_x, centroids_y
centroids_x = centroids[:,0]
centroids_y = centroids[:,1]

# Make a scatter plot of centroids_x and centroids_y
plt.scatter(centroids_x, centroids_y, marker='D', s=50)
plt.show()
Source by campus.datacamp.com #
 
PREVIOUS NEXT
Tagged: #visualising #centroid #unsupervised #learning #algorithm
ADD COMMENT
Topic
Name
4+7 =