gov.sandia.cognition.learning.algorithm.clustering.divergence
Class ClusterMeanLinkDivergenceFunction<ClusterType extends Cluster<DataType>,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<ClusterType,DataType>
              extended by gov.sandia.cognition.learning.algorithm.clustering.divergence.ClusterMeanLinkDivergenceFunction<ClusterType,DataType>
Type Parameters:
ClusterType - type of Cluster<DataType> used in the learn() method
DataType - The algorithm operates on a Collection<DataType>, so DataType will be something like Vector or String
All Implemented Interfaces:
ClusterToClusterDivergenceFunction<ClusterType,DataType>, DivergenceFunctionContainer<DataType,DataType>, DivergenceFunction<ClusterType,ClusterType>, CloneableSerializable, Serializable, Cloneable

@CodeReview(reviewer="Kevin R. Dixon",
            date="2008-07-23",
            changesNeeded=false,
            comments={"Cleaned up javadoc a little bit with code annotations.","Otherwise, looks fine."})
public class ClusterMeanLinkDivergenceFunction<ClusterType extends Cluster<DataType>,DataType>
extends AbstractClusterToClusterDivergenceFunction<ClusterType,DataType>

The ClusterMeanLinkDivergenceFunction class implements the mean linkage distance metric between two clusters. That is, the value returned by the metric is the mean distance between any point in the first cluster and any point in the second cluster.

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
ClusterMeanLinkDivergenceFunction()
          Creates a new instance of ClusterMeanLinkDivergenceFunction.
ClusterMeanLinkDivergenceFunction(DivergenceFunction<? super DataType,? super DataType> divergenceFunction)
          Creates a new instance of ClusterMeanLinkDivergenceFunction using the given divergence function for elements.
 
Method Summary
 double evaluate(ClusterType from, ClusterType to)
          The 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

ClusterMeanLinkDivergenceFunction

public ClusterMeanLinkDivergenceFunction()
Creates a new instance of ClusterMeanLinkDivergenceFunction.


ClusterMeanLinkDivergenceFunction

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

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

evaluate

public double evaluate(ClusterType from,
                       ClusterType to)
The method computes the complete link distance between the two given Clusters. The distance returned is the mean distance between a member of the first cluster and a member of the second cluster.

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