• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Compute cluster centroid

How can i compute the center of a class?
if each class has many many elements.
0
dadadude
Asked:
dadadude
1 Solution
 
Ultra_MasterCommented:
Have a look here for various methods:
http://en.wikipedia.org/wiki/Cluster_analysis
0
 
TommySzalapskiCommented:
The centroid is generally calculated as the average of all the points. I assume your classes have X,Y coordinates in there somewhere? (or X,Y,Z, or something). Just take the average of each and that's the centroid.

If you need to have one existing element be the centroid, then just use euclidean distance to find the closest one to the average location.

This is the standard way of doing it in almost all cases. You could also take the element that has the least total distance from all the others, but that takes a lot longer and will usually give you the same one anyway (maybe always).
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now