What is the meaning of c=y in knn in plt.scatter(x[:,0],x[:,1],c=y)

what is the meaning of c=y in knn algorithm in plt.scatter(x[:,0],x[:,1],c=y)

Hey @hssharma2212000, when you use c = ‘red’ than all points are shown with red colour, similarly when you pass c = y than each point individually recieved 0 or 1 as its color. plt.scatter itself assigns color encoding meaning say it assigned 0 as yellow and 1 as blue than each point which has y=0 will be shown on graph using yellow color and those with y=1 will be shown using blue color.

Hope this resolved your doubt
Plz mark the doubt as resolved in my doubts section. :blush: