public class HierarchicalFloatPathAssigner extends Object implements SoftAssigner<float[],float[]>
SoftAssigner
for gathering the clusters assigned
to a point from a hierarchical clustering. The returned clusters
represent the path down the tree to the final closest leaf node.Modifier and Type | Field and Description |
---|---|
protected Map<CentroidsProvider<float[]>,HardAssigner<float[],float[],IntFloatPair>> |
assigners |
protected HierarchicalFloatKMeansResult |
result |
Constructor and Description |
---|
HierarchicalFloatPathAssigner(HierarchicalFloatKMeansResult result)
Construct with the given
HierarchicalFloatKMeansResult instance. |
Modifier and Type | Method and Description |
---|---|
int[] |
assign(float[] data)
Assign a single point to some clusters.
|
int[][] |
assign(float[][] data)
Assign data to clusters.
|
IndependentPair<int[],float[]> |
assignWeighted(float[] data)
Assign a single point to some clusters.
|
void |
assignWeighted(float[][] data,
int[][] assignments,
float[][] weights)
Assign data to clusters.
|
int |
numDimensions()
Get the number of dimensions of the input vectors.
|
int |
size()
The number of clusters.
|
protected HierarchicalFloatKMeansResult result
protected Map<CentroidsProvider<float[]>,HardAssigner<float[],float[],IntFloatPair>> assigners
public HierarchicalFloatPathAssigner(HierarchicalFloatKMeansResult result)
HierarchicalFloatKMeansResult
instance.result
- the HierarchicalFloatKMeansResult
instance.public int[][] assign(float[][] data)
SoftAssigner
assign
in interface SoftAssigner<float[],float[]>
data
- the data.public int[] assign(float[] data)
SoftAssigner
assign
in interface SoftAssigner<float[],float[]>
data
- datum to assign.public void assignWeighted(float[][] data, int[][] assignments, float[][] weights)
SoftAssigner
assignWeighted
in interface SoftAssigner<float[],float[]>
data
- the data.assignments
- the cluster indices for each data point.weights
- the weights to the for each cluster for each data point.public IndependentPair<int[],float[]> assignWeighted(float[] data)
SoftAssigner
assignWeighted
in interface SoftAssigner<float[],float[]>
data
- point to assign.public int numDimensions()
Assigner
numDimensions
in interface Assigner<float[]>
public int size()
SoftAssigner
size
in interface SoftAssigner<float[],float[]>