org.jscience.computing.kmeans
Class Cluster

java.lang.Object
  extended by org.jscience.computing.kmeans.DataSet
      extended by org.jscience.computing.kmeans.Cluster

public class Cluster
extends DataSet

Represents a collection of samples in a cluster.


Field Summary
 
Fields inherited from class org.jscience.computing.kmeans.DataSet
dataset
 
Constructor Summary
Cluster(java.util.Vector collection)
          Generates a cluster from given set vector of examples.
 
Method Summary
 Coordinate average()
           
 double likelihood(Coordinate sample)
          Finds the loglikelihood of this sample given the cluster.
 double standardDeviation(DataSet dataset, int axis)
          Get the standard deviation of points in given dataset given the mean of this cluster.
 double standardDeviation(int axis)
          Get the standard deviation of this cluster in a given axis.
 
Methods inherited from class org.jscience.computing.kmeans.DataSet
dimension, iterator, numSamples, randomIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cluster

public Cluster(java.util.Vector collection)
Generates a cluster from given set vector of examples.

Parameters:
collection - The collection of samples in this cluster.
dimension - The dimension of this collection
Method Detail

average

public Coordinate average()
Returns:
The coordinate of the average of the coordinates in this cluster.

standardDeviation

public double standardDeviation(int axis)
Get the standard deviation of this cluster in a given axis.

Parameters:
axis - The axis (0<=x

standardDeviation

public double standardDeviation(DataSet dataset,
                                int axis)
Get the standard deviation of points in given dataset given the mean of this cluster.

Parameters:
dataset - The dataset to compare.
axis - The axis (0<=x

likelihood

public double likelihood(Coordinate sample)
Finds the loglikelihood of this sample given the cluster.

Parameters:
sample - The sample to test against this cluster.
Returns:
The log likelihood of this data given the cluster.