Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Compute cluster centroid

Posted on 2011-02-24
Medium Priority
387 Views
How can i compute the center of a class?
if each class has many many elements.
0
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 5

Expert Comment

ID: 34972167
Have a look here for various methods:
http://en.wikipedia.org/wiki/Cluster_analysis
0

LVL 37

Accepted Solution

TommySzalapski earned 2000 total points
ID: 34987452
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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of Google's most recent algorithm changes affecting local searches is entitled "The Pigeon Update." This update has dramatically enhanced search inquires for the keyword "Yelp." Google searches with the word "Yelp" included will now yield Yelp a…
Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
###### Suggested Courses
Course of the Month10 days, 10 hours left to enroll