public class RandomSetDoubleClusterer extends RandomDoubleClusterer
RandomSetDoubleClusterer
however it is
guaranteed that the same training vector will not be sampled more than once.K, M, random, seed
Constructor and Description |
---|
RandomSetDoubleClusterer(int M)
Creates a new random byte cluster used to create K centroids with data containing M elements.
|
RandomSetDoubleClusterer(int M,
int K)
Creates a new random byte cluster used to create centroids with data containing M elements.
|
Modifier and Type | Method and Description |
---|---|
DoubleCentroidsResult |
cluster(DataSource<double[]> data)
Selects K elements from the provided
DataSource as the centroids of the clusters. |
DoubleCentroidsResult |
cluster(double[][] data)
Selects K elements from the provided data as the centroids of the clusters.
|
performClustering, setSeed
public RandomSetDoubleClusterer(int M)
M
- number of elements in each data vectorpublic RandomSetDoubleClusterer(int M, int K)
M
- number of elements in each data vectorK
- number of centroids to be createdpublic DoubleCentroidsResult cluster(double[][] data)
cluster
in interface SpatialClusterer<DoubleCentroidsResult,double[]>
cluster
in class RandomDoubleClusterer
data
- the data.public DoubleCentroidsResult cluster(DataSource<double[]> data)
DataSource
as the centroids of the clusters.
If K is -1 all provided data points will be selected. It is guaranteed that the same data
point will not be selected many times, though this is not the case if two seperate entries
provided are identical.cluster
in interface SpatialClusterer<DoubleCentroidsResult,double[]>
cluster
in class RandomDoubleClusterer
data
- the data.