public class ExactLongAssigner extends Object implements HardAssigner<long[],double[],IntDoublePair>
HardAssigner that assigns points to the closest
cluster based on the distance to the centroid.| Modifier and Type | Field and Description |
|---|---|
protected LongNearestNeighboursExact |
nn |
| Constructor and Description |
|---|
ExactLongAssigner(CentroidsProvider<long[]> provider)
Construct the assigner using the given cluster data.
|
ExactLongAssigner(CentroidsProvider<long[]> provider,
LongFVComparator comparison)
Construct the assigner using the given cluster data and
distance function.
|
ExactLongAssigner(long[][] data,
LongFVComparator comparison)
Construct the assigner using the given cluster data and
distance function.
|
| 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.
|
LongNearestNeighboursExact |
getNN()
Get the underlying nearest-neighbour implementation.
|
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 LongNearestNeighboursExact nn
public ExactLongAssigner(CentroidsProvider<long[]> provider)
provider - the cluster data providerpublic ExactLongAssigner(CentroidsProvider<long[]> provider, LongFVComparator comparison)
provider - the cluster data providercomparison - the distance functionpublic ExactLongAssigner(long[][] data, LongFVComparator comparison)
data - the cluster datacomparison - the distance functionpublic int[] assign(long[][] data)
HardAssignerassign in interface HardAssigner<long[],double[],IntDoublePair>data - the data.public int assign(long[] data)
HardAssignerassign in interface HardAssigner<long[],double[],IntDoublePair>data - datum to assign.public void assignDistance(long[][] data, int[] indices, double[] distances)
HardAssignerassignDistance 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)
HardAssignerassignDistance in interface HardAssigner<long[],double[],IntDoublePair>data - point to assign.public int size()
HardAssignersize in interface HardAssigner<long[],double[],IntDoublePair>public int numDimensions()
AssignernumDimensions in interface Assigner<long[]>public LongNearestNeighboursExact getNN()