com.sun.labs.minion.clustering
Class ClusterStatisticsImpl

java.lang.Object
  extended by com.sun.labs.minion.clustering.ClusterStatisticsImpl
All Implemented Interfaces:
ClusterStatistics

public class ClusterStatisticsImpl
extends java.lang.Object
implements ClusterStatistics

An implementation of the cluster statistics interface.


Constructor Summary
ClusterStatisticsImpl()
           
 
Method Summary
 void add(double d)
           
 double mean()
          Calculates the mean distance of the cluster elements from the cluster centroid.
 int size()
          Gets the number of elements in the cluster.
 java.lang.String toString()
           
 double variance()
          Calculates the variance of the distance of the cluster elements from the cluster centroid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClusterStatisticsImpl

public ClusterStatisticsImpl()
Method Detail

add

public void add(double d)

size

public int size()
Description copied from interface: ClusterStatistics
Gets the number of elements in the cluster.

Specified by:
size in interface ClusterStatistics
Returns:
the number of elements in this cluster

mean

public double mean()
Calculates the mean distance of the cluster elements from the cluster centroid.

Specified by:
mean in interface ClusterStatistics
Returns:
the mean distance of the cluster elements from the cluster centroid.

variance

public double variance()
Calculates the variance of the distance of the cluster elements from the cluster centroid. This implementation calculates the bias-corrected sample variance.

Specified by:
variance in interface ClusterStatistics
Returns:
the variance of the distance of the cluster elements from the cluster centroid.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object