Find Cluster representative

dadadude
dadadude used Ask the Experts™
on
Hello,
I have a cluster C = [v1,v2,...,Vn] i am trying to find a Vector vi that can be the representative of that cluster, and i don't think that what i am doing is right, that's the pseudo code:
in the code:
I do the following:
For all vectors in C (i)
    sum = 0
     For all vectors in C (j)
            sum+ = d(vi,vj);
   // add distance and vector to a list
   list.add(d)

find the vector with the minimum distance. Is that wrong?
thank you
List<Values> distance = new List<Values>();
        for (int i = 0; i < tab.Count; i++)
        {
            double sum = 0.0;  
            for (int j = 0; j < tab.Count; j++)
            {
               //tab[i] and tab[j] are 2 vectors
                sum += ManhattanDistance(tab[i],tab[j]);
                
            }
            distance.Add(new Values(tab[i],sum));
        }//end for
        distance.Sort(Values.CompareCarSpecs);
        return distance[0].Vector;

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2014
Top Expert 2015
Commented:
if you think that the median value is a good representative of values on linear scale,
and that ManhattanDistance is a good way to combine the distance measures on different components,
then  your method seems reasonable.
Awarded 2010
Top Expert 2013
Commented:
Are you sure you want to use Manhattan Distance? From what I've seen, it's used more often than it should be.

Manhattan distance only makes sense if a 'zigzag' movement pattern makes sense (i.e. straight line distance can not be used). If there is no reason against using straight lines when discussing distance, then you should probably be using Euclidean distance.

http://en.wiktionary.org/wiki/Manhattan_distance

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial