Step 3 please explain

Can you please explain step 3 taking mean i wasnt able to understand ?

Hey @gauthampkrishnan, in step 2 we have assigned some customers to some randomly selected pizza centers. After this in the step 3 we have customers belonging to 3 different pizza centers. Now we take the coordinates of all the customers in a single pizza cluster(center) and then take the mean/average of them to get the new centroid or new location of pizza center.

Now you maybe thinking why do we take the mean of all the customers inside a single cluster. We do this so as to find a new pizza center inside the cluster which is equidistant (to some extent) from all the customers. All the customers can get easy access to the pizza center.

So if we have four customers C1, C2, C3, C4 inside a cluster , then their positions maybe (X1,Y1), (X2,Y2), (X3,Y3) and (X4,Y4). So taking their mean or finding the new pizza center location means

(X1+X2+X3+X4) / 4 , (Y1+Y2+Y3+Y4) / 4) = New center of the cluster

Hope this helps.
Happy Learning :slight_smile: