public class KDTreeShortEuclideanAssigner extends Object implements HardAssigner<short[],float[],IntFloatPair>
HardAssigner
that uses a ShortNearestNeighboursKDTree
to
generate approximately correct cluster assignments.Modifier and Type | Field and Description |
---|---|
protected ShortNearestNeighboursKDTree |
nn |
Constructor and Description |
---|
KDTreeShortEuclideanAssigner(CentroidsProvider<short[]> provider)
Construct the assigner using the given cluster data.
|
KDTreeShortEuclideanAssigner(short[][] data)
Construct the assigner using the given cluster data.
|
Modifier and Type | Method and Description |
---|---|
int |
assign(short[] data)
Assign a single point to a cluster.
|
int[] |
assign(short[][] data)
Assign data to a cluster.
|
IntFloatPair |
assignDistance(short[] data)
Assign a single point to a cluster.
|
void |
assignDistance(short[][] 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 ShortNearestNeighboursKDTree nn
public KDTreeShortEuclideanAssigner(CentroidsProvider<short[]> provider)
provider
- the cluster data providerpublic KDTreeShortEuclideanAssigner(short[][] data)
data
- the cluster datapublic int[] assign(short[][] data)
HardAssigner
assign
in interface HardAssigner<short[],float[],IntFloatPair>
data
- the data.public int assign(short[] data)
HardAssigner
assign
in interface HardAssigner<short[],float[],IntFloatPair>
data
- datum to assign.public void assignDistance(short[][] data, int[] indices, float[] distances)
HardAssigner
assignDistance
in interface HardAssigner<short[],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(short[] data)
HardAssigner
assignDistance
in interface HardAssigner<short[],float[],IntFloatPair>
data
- point to assign.public int size()
HardAssigner
size
in interface HardAssigner<short[],float[],IntFloatPair>
public int numDimensions()
Assigner
numDimensions
in interface Assigner<short[]>