public class KDTreeByteEuclideanAssigner extends Object implements HardAssigner<byte[],float[],IntFloatPair>
HardAssigner that uses a ByteNearestNeighboursKDTree to
generate approximately correct cluster assignments.| Modifier and Type | Field and Description |
|---|---|
protected ByteNearestNeighboursKDTree |
nn |
| Constructor and Description |
|---|
KDTreeByteEuclideanAssigner(byte[][] data)
Construct the assigner using the given cluster data.
|
KDTreeByteEuclideanAssigner(CentroidsProvider<byte[]> provider)
Construct the assigner using the given cluster data.
|
| Modifier and Type | Method and Description |
|---|---|
int |
assign(byte[] data)
Assign a single point to a cluster.
|
int[] |
assign(byte[][] data)
Assign data to a cluster.
|
IntFloatPair |
assignDistance(byte[] data)
Assign a single point to a cluster.
|
void |
assignDistance(byte[][] data,
int[] indices,
float[] distances)
Assign data to clusters.
|
int |
numDimensions()
Get the number of dimensions of the input vectors.
|
int |
size()
The number of centroids or unique ids that can be generated.
|
protected ByteNearestNeighboursKDTree nn
public KDTreeByteEuclideanAssigner(CentroidsProvider<byte[]> provider)
provider - the cluster data providerpublic KDTreeByteEuclideanAssigner(byte[][] data)
data - the cluster datapublic int[] assign(byte[][] data)
HardAssignerassign in interface HardAssigner<byte[],float[],IntFloatPair>data - the data.public int assign(byte[] data)
HardAssignerassign in interface HardAssigner<byte[],float[],IntFloatPair>data - datum to assign.public void assignDistance(byte[][] data, int[] indices, float[] distances)
HardAssignerassignDistance in interface HardAssigner<byte[],float[],IntFloatPair>data - the data.indices - the cluster index for each data point.distances - the distance to the closest cluster for each data point.public IntFloatPair assignDistance(byte[] data)
HardAssignerassignDistance in interface HardAssigner<byte[],float[],IntFloatPair>data - point to assign.public int size()
HardAssignersize in interface HardAssigner<byte[],float[],IntFloatPair>public int numDimensions()
AssignernumDimensions in interface Assigner<byte[]>