public class HierarchicalShortKMeansResult extends Object implements SpatialClusters<short[]>
HierarchicalShortKMeans clustering operation.| Modifier and Type | Class and Description |
|---|---|
static class |
HierarchicalShortKMeansResult.Node
HierarchicalShortKMeans tree node
The number of children is not bigger than the HierarchicalShortKMeans K parameter
|
CLUSTER_HEADER| Modifier | Constructor and Description |
|---|---|
protected |
HierarchicalShortKMeansResult() |
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
int |
countActiveLeafNodes()
Count number of active leaf nodes.
|
int |
countLeafs()
Total number of leaves assuming leaves = K^depth
|
HierarchicalShortHardAssigner |
defaultHardAssigner()
Get the default hard assigner for this clusterer.
|
boolean |
equals(Object o) |
short[] |
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.
|
HierarchicalShortKMeansResult.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)
Read internal state from in.
|
void |
readBinary(DataInput dis)
Read internal state from in.
|
String |
toString() |
void |
writeASCII(PrintWriter writer)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput dos)
Write the content of this as binary to out.
|
protected HierarchicalShortKMeansResult()
public int numDimensions()
SpatialClustersnumDimensions in interface SpatialClusters<short[]>public int getK()
public int getDepth()
public HierarchicalShortKMeansResult.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<short[]>public short[] getClusterCentroid(int[] path)
path - public String asciiHeader()
ReadableASCIIasciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic byte[] binaryHeader()
ReadableBinarybinaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void readASCII(Scanner reader) throws IOException
ReadableASCIIreadASCII in interface ReadableASCIIreader - source to read from.IOException - an error reading inputpublic void readBinary(DataInput dis) throws IOException
ReadableBinaryreadBinary in interface ReadableBinarydis - source to read from.IOException - an error reading inputpublic void writeASCII(PrintWriter writer) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIwriter - sink to write toIOException - an error writing to outpublic void writeBinary(DataOutput dos) throws IOException
WriteableBinarywriteBinary in interface WriteableBinarydos - sink to write toIOException - an error writing to outpublic HierarchicalShortHardAssigner defaultHardAssigner()
SpatialClustersdefaultHardAssigner in interface SpatialClusters<short[]>