<p>For the one dimensional case, you can use the <a href="http://en.wikipedia.org/wiki/Variance" rel="nofollow">variance</a>.</p>

<p>For the higher dimensions, you can generalize the variance by first computing a mean point and then computing the sum of the square of the distance between each point and the mean squared followed by a division the sum by the number of points. This division by the number of points (which also happens in the variance) is the difference between the solution you have suggested and what I am recommending.  This division allows for a fair comparison of clustering between sets of points of different sizes.</p>

<p>For $n$ points with mean point $m$, the computation is $\frac{1}{n} \sum_{i=1}^n \operatorname{dist}(m, p_i)^2$.</p>

CC BY-SA 3.0
2011-07-10T05:06:05.833Z
This seems as though it assumes there is only a single cluster. In my Set A example, I was intending to show -2 and 1 as a cluster and 5 adn 7 as another cluster. I could apply a clustering algorithm then compute the variance of each, but something tha works in one fell swoop would be great. EDIT: I'm thinking I will use variance in conjunction with bisection clustering.
Eric Pruitt
CC BY-SA 3.0
2011-07-11T12:36:55.967Z
@Eric Pruitt Yes, I agree. This answer is based on the way I read your question; that the sets of numbers that you want to compare have already been created.
Tyson Williams
CC BY-SA 3.0
2011-07-11T12:40:04.257Z
The sets were intended to be _full_ data sets, not pre-computed clusters. EDIT: I modified the OP.
Eric Pruitt
CC BY-SA 3.0
2011-07-08T04:22:09.990Z
2011-07-08T12:24:16.023Z
2011-07-08T12:24:16.023Z
Tyson Williams
<p>I have a sparse set of points with unpredictable locations. I need a way of "scoring" each set of points such that clustering is rewarded. My working case is actually one dimensional, but a two dimensional use case may come up later.</p>

<p>Here's an example:
Data A contains points at -2, 1, 5, 7. Data B has points at -10, 0, 20, 6. A and B are independent of each other and have not had clustering applied. Ideally, after clustering, A would have clusters (-2, 1) and (5, 7). There is more clustering in A so I would like it scored higher. Bonus points if the algorithm allows the points to have variable values so that in some cases, if points are 100 units apart but each of the points has a high value, that set of points will rate higher than a set of points 10 units apart with much lower values.</p>

<p>EDIT: My current idea is to use a clustering algorithm to figure out the center of each cluster and it figure out which points occupy the cluster. I would then score each cluster finding the mean of the distances squared (EDIT: Apparently this is called "variance."). </p>

CC BY-SA 3.0
2011-07-07T23:54:46.897Z
Without more information, your proposed approach seems perfectly reasonable.
Suresh Venkat
<clustering>
Scoring set of points based on clustering
Eric Pruitt
# Scoring set of points based on clustering

(Asked by: username_0 on 2011-07-07)

I have a sparse set of points with unpredictable locations. I need a way of "scoring" each set of points such that clustering is rewarded. My working case is actually one dimensional, but a two dimensional use case may come up later.

Here's an example:
Data A contains points at -2, 1, 5, 7. Data B has points at -10, 0, 20, 6. A and B are independent of each other and have not had clustering applied. Ideally, after clustering, A would have clusters (-2, 1) and (5, 7). There is more clustering in A so I would like it scored higher. Bonus points if the algorithm allows the points to have variable values so that in some cases, if points are 100 units apart but each of the points has a high value, that set of points will rate higher than a set of points 10 units apart with much lower values.

EDIT: My current idea is to use a clustering algorithm to figure out the center of each cluster and it figure out which points occupy the cluster. I would then score each cluster finding the mean of the distances squared (EDIT: Apparently this is called "variance.").

**Tags:** clustering
> **Comments:**
> **username_1**: Without more information, your proposed approach seems perfectly reasonable.  

---

## 1 answers

### Answer by username_2 on 2011-07-08. Score: 2

For the one dimensional case, you can use the [variance](http://en.wikipedia.org/wiki/Variance).

For the higher dimensions, you can generalize the variance by first computing a mean point and then computing the sum of the square of the distance between each point and the mean squared followed by a division the sum by the number of points. This division by the number of points (which also happens in the variance) is the difference between the solution you have suggested and what I am recommending. This division allows for a fair comparison of clustering between sets of points of different sizes.

For $n$ points with mean point $m$, the computation is $\frac{1}{n} \sum\_{i=1}^n \operatorname{dist}(m, p\_i)^2$.

> **Comments:**
> **username_0**: This seems as though it assumes there is only a single cluster. In my Set A example, I was intending to show -2 and 1 as a cluster and 5 adn 7 as another cluster. I could apply a clustering algorithm then compute the variance of each, but something tha works in one fell swoop would be great. EDIT: I'm thinking I will use variance in conjunction with bisection clustering.  
> **username_2**: @Eric Pruitt Yes, I agree. This answer is based on the way I read your question; that the sets of numbers that you want to compare have already been created.  
> **username_0**: The sets were intended to be _full_ data sets, not pre-computed clusters. EDIT: I modified the OP.  

---

