public class HierarchicalByteKMeansResult extends Object implements SpatialClusters<byte[]>
HierarchicalByteKMeans clustering operation.| Modifier and Type | Class and Description |
|---|---|
static class |
HierarchicalByteKMeansResult.Node
HierarchicalByteKMeans tree node
The number of children is not bigger than the HierarchicalByteKMeans K parameter
|
CLUSTER_HEADER| Modifier | Constructor and Description |
|---|---|
protected |
HierarchicalByteKMeansResult() |
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader() |
byte[] |
binaryHeader() |
int |
countActiveLeafNodes()
Count number of active leaf nodes.
|
int |
countLeafs()
Total number of leaves assuming leaves = K^depth
|
HierarchicalByteHardAssigner |
defaultHardAssigner()
Get the default hard assigner for this clusterer.
|
boolean |
equals(Object o) |
byte[] |
getClusterCentroid(int[] path)
Given a path, get the cluster centroid associated with the cluster index of the path.
|
int |
getDepth()
Get the depth of the cluster tree
|
int |
getIndex(int[] path)
Translates a path down the KDTree as a cluster index.
|
static int |
getIndex(int[] path,
int depth,
int K)
Translates a path down the KDTree as a cluster index.
|
int |
getK()
Get the number of clusters per node
|
int[] |
getPath(int index)
Given an index, what was the path down the hierarchy that lead to it.
|
static int[] |
getPath(int index,
int depth,
int K)
Given an index, what was the path down the hierarchy that lead to it.
|
HierarchicalByteKMeansResult.Node |
getRoot()
Get the root node of the tree
|
int |
numClusters()
Get the number of clusters.
|
int |
numDimensions()
Get the data dimensionality
|
void |
readASCII(Scanner reader) |
void |
readBinary(DataInput dis) |
String |
toString() |
void |
writeASCII(PrintWriter writer) |
void |
writeBinary(DataOutput dos) |
protected HierarchicalByteKMeansResult()
public int numDimensions()
SpatialClustersnumDimensions in interface SpatialClusters<byte[]>public int getK()
public int getDepth()
public HierarchicalByteKMeansResult.Node getRoot()
public static int getIndex(int[] path, int depth, int K)
path - depth - K - public int getIndex(int[] path)
path - public static int[] getPath(int index, int depth, int K)
index - depth - K - public int[] getPath(int index)
index - public int countActiveLeafNodes()
public int countLeafs()
public int numClusters()
SpatialClustersnumClusters in interface SpatialClusters<byte[]>public byte[] getClusterCentroid(int[] path)
path - public String asciiHeader()
asciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic byte[] binaryHeader()
binaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void readASCII(Scanner reader) throws IOException
readASCII in interface ReadableASCIIIOExceptionpublic void readBinary(DataInput dis) throws IOException
readBinary in interface ReadableBinaryIOExceptionpublic void writeASCII(PrintWriter writer) throws IOException
writeASCII in interface WriteableASCIIIOExceptionpublic void writeBinary(DataOutput dos) throws IOException
writeBinary in interface WriteableBinaryIOExceptionpublic HierarchicalByteHardAssigner defaultHardAssigner()
SpatialClustersdefaultHardAssigner in interface SpatialClusters<byte[]>