Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to plot a single centroid

df['target'] = kmean_model.predict(df)
#plotting the first cluster
plt.scatter(df[df['target']==1].iloc[:,0],df[df['target']==1].iloc[:,1],cmap = 'viridis')
plt.scatter(kmean_model.cluster_centers_[1,0],kmean_model.cluster_centers_[1,1],c='red',marker = 'x')
 
PREVIOUS NEXT
Tagged: #plot #single #centroid
ADD COMMENT
Topic
Name
5+8 =