Computing a centroid of a given cluster

A centroid of a cluster is just an average of the points in a cluster. If a cluster contains 1 dimensional points with the coordinates x1, x2, …, xn, then the centroid of that cluster would be (1/n)*(x1+x2+...+xn). If a cluster contains 2 dimensional points with the coordinates (x1,y1),(x2,y2),…,(xn,yn), then the x coordinate of the centroid of the cluster would have value (1/n)*(x1+x2+...+xn), the y coordinate would have the value (1/n)*(y1+y2+...+yn).

This computation generalizes easily to higher dimensions. If the value of the higher dimensional features for the x-coordinate are x1, x2, …, xn, then the value at the x-coordinate for the centroid is (1/n)*(x1+x2+...+xn).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset