public class HierarchicalDoublePathAssigner extends Object implements SoftAssigner<double[],double[]>
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<double[]>,HardAssigner<double[],double[],IntDoublePair>> |
assigners |
protected HierarchicalDoubleKMeansResult |
result |
Constructor and Description |
---|
HierarchicalDoublePathAssigner(HierarchicalDoubleKMeansResult result)
Construct with the given
HierarchicalDoubleKMeansResult instance. |
Modifier and Type | Method and Description |
---|---|
int[] |
assign(double[] data)
Assign a single point to some clusters.
|
int[][] |
assign(double[][] data)
Assign data to clusters.
|
IndependentPair<int[],double[]> |
assignWeighted(double[] data)
Assign a single point to some clusters.
|
void |
assignWeighted(double[][] data,
int[][] assignments,
double[][] weights)
Assign data to clusters.
|
int |
numDimensions()
Get the number of dimensions of the input vectors.
|
int |
size()
The number of clusters.
|
protected HierarchicalDoubleKMeansResult result
protected Map<CentroidsProvider<double[]>,HardAssigner<double[],double[],IntDoublePair>> assigners
public HierarchicalDoublePathAssigner(HierarchicalDoubleKMeansResult result)
HierarchicalDoubleKMeansResult
instance.result
- the HierarchicalDoubleKMeansResult
instance.public int[][] assign(double[][] data)
SoftAssigner
assign
in interface SoftAssigner<double[],double[]>
data
- the data.public int[] assign(double[] data)
SoftAssigner
assign
in interface SoftAssigner<double[],double[]>
data
- datum to assign.public void assignWeighted(double[][] data, int[][] assignments, double[][] weights)
SoftAssigner
assignWeighted
in interface SoftAssigner<double[],double[]>
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[],double[]> assignWeighted(double[] data)
SoftAssigner
assignWeighted
in interface SoftAssigner<double[],double[]>
data
- point to assign.public int numDimensions()
Assigner
numDimensions
in interface Assigner<double[]>
public int size()
SoftAssigner
size
in interface SoftAssigner<double[],double[]>