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