public class SphericalKMeansResult extends Object implements SpatialClusters<double[]>, CentroidsProvider<double[]>
SpatialClusterer that just produces a flat set of
centroids.| Modifier and Type | Field and Description |
|---|---|
int[] |
assignments
The assignments of the training data to clusters
|
double[][] |
centroids
The centroids of the clusters
|
CLUSTER_HEADER| Constructor and Description |
|---|
SphericalKMeansResult() |
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader() |
byte[] |
binaryHeader() |
HardAssigner<double[],double[],IntDoublePair> |
defaultHardAssigner()
Get the default hard assigner for this clusterer.
|
boolean |
equals(Object obj) |
double[][] |
filter(int threshold)
Filter the cluster centroids be removing those with less than threshold
items
|
int[] |
getAssignmentHistogram()
Compute the histogram of number of assignments to each cluster
|
double[][] |
getCentroids() |
int |
numClusters()
Get the number of clusters.
|
int |
numDimensions()
Get the data dimensionality
|
void |
readASCII(Scanner br) |
void |
readBinary(DataInput in) |
String |
toString() |
void |
writeASCII(PrintWriter writer) |
void |
writeBinary(DataOutput out) |
public double[][] centroids
public int[] assignments
public SphericalKMeansResult()
public String asciiHeader()
asciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic byte[] binaryHeader()
binaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void readASCII(Scanner br) throws IOException
readASCII in interface ReadableASCIIIOExceptionpublic void readBinary(DataInput in) throws IOException
readBinary in interface ReadableBinaryIOExceptionpublic void writeASCII(PrintWriter writer) throws IOException
writeASCII in interface WriteableASCIIIOExceptionpublic void writeBinary(DataOutput out) throws IOException
writeBinary in interface WriteableBinaryIOExceptionpublic double[][] getCentroids()
getCentroids in interface CentroidsProvider<double[]>public HardAssigner<double[],double[],IntDoublePair> defaultHardAssigner()
SpatialClustersdefaultHardAssigner in interface SpatialClusters<double[]>public int numDimensions()
SpatialClustersnumDimensions in interface SpatialClusters<double[]>public int numClusters()
SpatialClustersnumClusters in interface SpatialClusters<double[]>public int[] getAssignmentHistogram()
public double[][] filter(int threshold)
threshold - minimum number of items