org.jscience.computing.kmeans
Class ClusterSet

java.lang.Object
  extended by org.jscience.computing.kmeans.ClusterSet

public class ClusterSet
extends java.lang.Object

Represents a collection of clusters, and allows operations on them.


Constructor Summary
ClusterSet(int numClusters)
          Constructs an empty clusterset of given length.
 
Method Summary
 double descriptionLength(DataSet dataset)
          Get the description length of this model.
 int dimension()
           
 Cluster get(int i)
          Accessor.
 java.util.Iterator iterator()
          Get an iterator for this clusterset.
 double logLikelihood(DataSet dataset)
          Get the log likelihood of this model given all the data.
 int numClusters()
          Get the size of this clusterset (not neccessarily the number of clusters contained.)
 double prior(int i)
          Get the prior probability of a cluster.
 void set(int i, Cluster cluster)
          Set a given cluster in the set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterSet

public ClusterSet(int numClusters)
Constructs an empty clusterset of given length.

Method Detail

numClusters

public int numClusters()
Get the size of this clusterset (not neccessarily the number of clusters contained.)

Returns:
The size of this clusterset.

set

public void set(int i,
                Cluster cluster)
Set a given cluster in the set.

Parameters:
i - The index of the cluster to set.
cluster - The cluster to place at that location.

get

public Cluster get(int i)
Accessor.

Parameters:
i - The index of the cluster to access.
Returns:
The wanted cluster.

iterator

public java.util.Iterator iterator()
Get an iterator for this clusterset.

Returns:
A cluster iterator.

prior

public double prior(int i)
Get the prior probability of a cluster.

Parameters:
i - The number of the cluster to examine.
Returns:
The prior probablity of this cluster.

dimension

public int dimension()
Returns:
The dimension of the clusters in this set.

logLikelihood

public double logLikelihood(DataSet dataset)
Get the log likelihood of this model given all the data.

Parameters:
dataset - All the samples.
Returns:
The log likelihood of this model.

descriptionLength

public double descriptionLength(DataSet dataset)
Get the description length of this model.

Parameters:
dataset - All the samples.
Returns:
The description length of this model.