Doubt in kmeans cluster

plt.figure(0)? why 0
plt.scatter(X[:,0],X[:,1]) means??

Hi @silpasweta,
In plt.figure(0) here 0 is the unique number of this particular figure, if this is left empty, every time a new figure is created with the number increment. So, Basically this is optional parameter.

plt.scatter(X[:,0],X[:,1]) the first parameter X[:,0] means we are considering all the values/rows of first column (index 0) on X-axis, and X[:,1] means taking all the values/rows from second column index(1) on Y axis. and we are scattering these values on 2 axis.

I hope this clears your doubt
Thanks :slight_smile:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.