gov.sandia.cognition.learning.algorithm.clustering.initializer
Class NeighborhoodGaussianClusterInitializer

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.util.AbstractRandomized
          extended by gov.sandia.cognition.learning.algorithm.clustering.initializer.NeighborhoodGaussianClusterInitializer
All Implemented Interfaces:
FixedClusterInitializer<GaussianCluster,Vector>, CloneableSerializable, Randomized, Serializable, Cloneable

@CodeReview(reviewer="Kevin R. Dixon",
            date="2008-07-23",
            changesNeeded=false,
            comments={"Now extends AbstractRandomized.","Got rid of C-style comments from inside methods.","Cleaned up javadoc a little bit with code annotations.","Otherwise, looks fine."})
public class NeighborhoodGaussianClusterInitializer
extends AbstractRandomized
implements FixedClusterInitializer<GaussianCluster,Vector>

Creates GaussianClusters near existing, but not on top of, data points. Also GaussianClusters are not created near each other.

Since:
1.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
static double DEFAULT_COVARIANCE
          Default covariance to put on the diagonal entries, 1.0.
static double DEFAULT_RANGE
          Default range of the "neighborhood", 1.0.
 
Fields inherited from class gov.sandia.cognition.util.AbstractRandomized
random
 
Constructor Summary
NeighborhoodGaussianClusterInitializer()
          Default constructor.
NeighborhoodGaussianClusterInitializer(double defaultCovariance, double randomRange, Random random)
          Creates a new instance of NeighborhoodGaussianClusterInitializer
NeighborhoodGaussianClusterInitializer(Random random)
          Creates a new instance of NeighborhoodGaussianClusterInitializer
 
Method Summary
 double getDefaultCovariance()
          Getter for defaultCovariance
 double getRandomRange()
          Getter for randomRange
 ArrayList<GaussianCluster> initializeClusters(int numClusters, Collection<? extends Vector> elements)
          Initializes a given number of clusters from the given elements.
 void setDefaultCovariance(double defaultCovariance)
          Setter for defaultCovariance
 void setRandomRange(double randomRange)
          Setter for randomRange
 
Methods inherited from class gov.sandia.cognition.util.AbstractRandomized
clone, getRandom, setRandom
 
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
 

Field Detail

DEFAULT_RANGE

public static final double DEFAULT_RANGE
Default range of the "neighborhood", 1.0.

See Also:
Constant Field Values

DEFAULT_COVARIANCE

public static final double DEFAULT_COVARIANCE
Default covariance to put on the diagonal entries, 1.0.

See Also:
Constant Field Values
Constructor Detail

NeighborhoodGaussianClusterInitializer

public NeighborhoodGaussianClusterInitializer()
Default constructor.


NeighborhoodGaussianClusterInitializer

public NeighborhoodGaussianClusterInitializer(Random random)
Creates a new instance of NeighborhoodGaussianClusterInitializer

Parameters:
random - random-number generator for the system

NeighborhoodGaussianClusterInitializer

public NeighborhoodGaussianClusterInitializer(double defaultCovariance,
                                              double randomRange,
                                              Random random)
Creates a new instance of NeighborhoodGaussianClusterInitializer

Parameters:
defaultCovariance - default diagonal covariance scaling factor
randomRange - range of the neighborhood from which to place the cluster
random - random-number generator for the system
Method Detail

getRandomRange

public double getRandomRange()
Getter for randomRange

Returns:
range of the neighborhood from which to place the cluster

setRandomRange

public void setRandomRange(double randomRange)
Setter for randomRange

Parameters:
randomRange - range of the neighborhood from which to place the cluster

getDefaultCovariance

public double getDefaultCovariance()
Getter for defaultCovariance

Returns:
default diagonal covariance scaling factor

setDefaultCovariance

public void setDefaultCovariance(double defaultCovariance)
Setter for defaultCovariance

Parameters:
defaultCovariance - default diagonal covariance scaling factor

initializeClusters

public ArrayList<GaussianCluster> initializeClusters(int numClusters,
                                                     Collection<? extends Vector> elements)
Description copied from interface: FixedClusterInitializer
Initializes a given number of clusters from the given elements.

Specified by:
initializeClusters in interface FixedClusterInitializer<GaussianCluster,Vector>
Parameters:
numClusters - The number of clusters to create.
elements - The elements to create the clusters from.
Returns:
The initial clusters to use.