gov.sandia.cognition.learning.algorithm.clustering.divergence
Class ClusterCentroidDivergenceFunction<DataType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer<DataType,DataType>
          extended by gov.sandia.cognition.learning.algorithm.clustering.divergence.AbstractClusterToClusterDivergenceFunction<CentroidCluster<DataType>,DataType>
              extended by gov.sandia.cognition.learning.algorithm.clustering.divergence.ClusterCentroidDivergenceFunction<DataType>
Type Parameters:
DataType - The algorithm operates on a Collection<DataType>, so DataType will be something like Vector or String
All Implemented Interfaces:
ClusterToClusterDivergenceFunction<CentroidCluster<DataType>,DataType>, DivergenceFunctionContainer<DataType,DataType>, DivergenceFunction<CentroidCluster<DataType>,CentroidCluster<DataType>>, CloneableSerializable, Serializable, Cloneable

@CodeReview(reviewer="Kevin R. Dixon",
            date="2008-07-23",
            changesNeeded=false,
            comments="Looks fine.")
public class ClusterCentroidDivergenceFunction<DataType>
extends AbstractClusterToClusterDivergenceFunction<CentroidCluster<DataType>,DataType>

The ClusterCentroidDivergenceFunction class implements the distance between two clusters by computing the distance between the cluster's centroid. When used in conjunction with a ClusterCreator that computes the mean of the member elements, this distance metric can compute the average group distance between the two clusters. It is important to link up the DivergenceFunction passed to this class with the ClusterCreator used to create the element for the clusters.

Since:
1.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer
divergenceFunction
 
Constructor Summary
ClusterCentroidDivergenceFunction()
          Creates a new instance of ClusterCompleteLinkDivergenceFunction.
ClusterCentroidDivergenceFunction(DivergenceFunction<? super DataType,? super DataType> divergenceFunction)
          Creates a new instance of ClusterCompleteLinkDivergenceFunction using the given divergence function for elements.
 
Method Summary
 double evaluate(CentroidCluster<DataType> from, CentroidCluster<DataType> to)
          This method computes the complete link distance between the two given Clusters.
 
Methods inherited from class gov.sandia.cognition.learning.function.distance.DefaultDivergenceFunctionContainer
clone, getDivergenceFunction, setDivergenceFunction
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

ClusterCentroidDivergenceFunction

public ClusterCentroidDivergenceFunction()
Creates a new instance of ClusterCompleteLinkDivergenceFunction.


ClusterCentroidDivergenceFunction

public ClusterCentroidDivergenceFunction(DivergenceFunction<? super DataType,? super DataType> divergenceFunction)
Creates a new instance of ClusterCompleteLinkDivergenceFunction using the given divergence function for elements.

Parameters:
divergenceFunction - The divergence function for elements.
Method Detail

evaluate

public double evaluate(CentroidCluster<DataType> from,
                       CentroidCluster<DataType> to)
This method computes the complete link distance between the two given Clusters. The distance returned is the distance between the element representing the center of the two clusters.

Parameters:
from - The first Cluster.
to - The second Cluster.
Returns:
The distance between the two given Clusters elements.