@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>
GaussianClusters are not created near each other.| Modifier and Type | Field and Description |
|---|---|
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.
|
random| Constructor and Description |
|---|
NeighborhoodGaussianClusterInitializer()
Default constructor.
|
NeighborhoodGaussianClusterInitializer(double defaultCovariance,
double randomRange,
java.util.Random random)
Creates a new instance of NeighborhoodGaussianClusterInitializer
|
NeighborhoodGaussianClusterInitializer(java.util.Random random)
Creates a new instance of NeighborhoodGaussianClusterInitializer
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDefaultCovariance()
Getter for defaultCovariance
|
double |
getRandomRange()
Getter for randomRange
|
java.util.ArrayList<GaussianCluster> |
initializeClusters(int numClusters,
java.util.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
|
clone, getRandom, setRandompublic static final double DEFAULT_RANGE
public static final double DEFAULT_COVARIANCE
public NeighborhoodGaussianClusterInitializer()
public NeighborhoodGaussianClusterInitializer(java.util.Random random)
random - random-number generator for the systempublic NeighborhoodGaussianClusterInitializer(double defaultCovariance,
double randomRange,
java.util.Random random)
defaultCovariance - default diagonal covariance scaling factorrandomRange - range of the neighborhood from which to place the clusterrandom - random-number generator for the systempublic double getRandomRange()
public void setRandomRange(double randomRange)
randomRange - range of the neighborhood from which to place the clusterpublic double getDefaultCovariance()
public void setDefaultCovariance(double defaultCovariance)
defaultCovariance - default diagonal covariance scaling factorpublic java.util.ArrayList<GaussianCluster> initializeClusters(int numClusters, java.util.Collection<? extends Vector> elements)
FixedClusterInitializerinitializeClusters in interface FixedClusterInitializer<GaussianCluster,Vector>numClusters - The number of clusters to create.elements - The elements to create the clusters from.