Search
 
SCRIPT & CODE EXAMPLE
 

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')
Comment

PREVIOUS NEXT
Code Example
Python :: python adding an item 
Python :: Getting TimeZone from lat long coordinate 
Python :: Sequential Execution EC2 
Python :: CHECK POLYGON IS VALID 
Python :: difference between iglob() and glob() functions in python 
Python :: python typing optional argument 
Python :: python evenly spaced integers 
Python :: apply WEKA filter on customer dataset 
Python :: Python NumPy atleast_3d Function Example when inputs are high dimesion 
Python :: Python NumPy ravel function example array.ravel is equivalent to reshape(-1, order=order) 
Python :: python terminal color 
Python :: how to extract a list of values from numpy array using index list 
Python :: Python NumPy asfortranarray Function Tuple to an array 
Python :: Python NumPy hstack Function Example with 2d array 
Python :: watchlist flask app 
Python :: python increase a value every n rows 
Python :: Python how to use __sub__ 
Python :: NumPy rot90 Example Rotating Once 
Python :: ignopre rankwarning pyton 
Python :: All possible combinations of multiple columns 
Python :: selenium python select elements data atribute 
Python :: how to show all rows whith a unique value in a column 
Python :: bouton 
Python :: python tkinter.ttk combobox down event on mouseclick 
Python :: store dataframes 
Python :: python output 
Python :: What is the right way to do such import 
Python :: cours python 
Python :: python for loop skip iteration if condition not met jinja 
Python :: ring define private attributes and methods 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =