public class HierarchicalLongHardAssigner extends Object implements HardAssigner<long[],double[],IntDoublePair>
HierarchicalLongHardAssigner
is a HardAssigner
for
HierarchicalLongKMeansResult
instances. The assigner
produces the index of the assigned leaf node as if the clusters were
actually flat.Modifier and Type | Class and Description |
---|---|
static class |
HierarchicalLongHardAssigner.ScoringScheme
The
HierarchicalLongHardAssigner.ScoringScheme determines how the distance
to a cluster is estimated from the hierarchy of k-means
generated clusters. |
Modifier and Type | Field and Description |
---|---|
protected HierarchicalLongPathAssigner |
path |
protected HierarchicalLongKMeansResult |
result |
protected HierarchicalLongHardAssigner.ScoringScheme |
scorer |
Constructor and Description |
---|
HierarchicalLongHardAssigner(HierarchicalLongKMeansResult result)
Construct with the given Hierarchical KMeans clusterer
and the SUM scoring scheme.
|
HierarchicalLongHardAssigner(HierarchicalLongKMeansResult result,
HierarchicalLongHardAssigner.ScoringScheme scorer)
Construct with the given hierarchical KMeans clusterer
and scoring scheme.
|
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 HierarchicalLongKMeansResult result
protected HierarchicalLongPathAssigner path
protected HierarchicalLongHardAssigner.ScoringScheme scorer
public HierarchicalLongHardAssigner(HierarchicalLongKMeansResult result, HierarchicalLongHardAssigner.ScoringScheme scorer)
result
- the hierarchical KMeans clustererscorer
- the scoring schemepublic HierarchicalLongHardAssigner(HierarchicalLongKMeansResult result)
result
- the hierarchical KMeans clustererpublic 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[]>