Package smile.plot.swing
Class Dendrogram
java.lang.Object
smile.plot.swing.Shape
smile.plot.swing.Plot
smile.plot.swing.Dendrogram
A dendrogram is a tree diagram frequently used to illustrate the arrangement
of the clusters produced by hierarchical clustering.
-
Constructor Summary
ConstructorDescriptionDendrogram
(int[][] merge, double[] height) Constructor.Dendrogram
(int[][] merge, double[] height, Color color) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncanvas()
Returns a canvas of the plot.double
Returns the height of tree.double[]
Returns the lower bound of data.double[]
Returns the upper bound of data.void
Draws the shape.
-
Constructor Details
-
Dendrogram
public Dendrogram(int[][] merge, double[] height) Constructor.- Parameters:
merge
- an n-1 by 2 matrix of which row i describes the merging of clusters at step i of the clustering. If an element j in the row is less than n, then observation j was merged at this stage. Ifj >= n
then the merge was with the cluster formed at the (earlier) stage j-n of the algorithm.height
- a set of n-1 non-decreasing real values, which are the clustering height, i.e., the value of the criterion associated with the clustering method for the particular agglomeration.
-
Dendrogram
Constructor.- Parameters:
merge
- an n-1 by 2 matrix of which row i describes the merging of clusters at step i of the clustering. If an element j in the row is less than n, then observation j was merged at this stage. Ifj >= n
then the merge was with the cluster formed at the (earlier) stage j-n of the algorithm.height
- a set of n-1 non-decreasing real values, which are the clustering height, i.e., the value of the criterion associated with the clustering method for the particular agglomeration.color
- the color for rendering the plot.
-
-
Method Details
-
getHeight
public double getHeight()Returns the height of tree. -
paint
Description copied from class:Shape
Draws the shape. -
getLowerBound
public double[] getLowerBound()Description copied from class:Plot
Returns the lower bound of data.- Specified by:
getLowerBound
in classPlot
-
getUpperBound
public double[] getUpperBound()Description copied from class:Plot
Returns the upper bound of data.- Specified by:
getUpperBound
in classPlot
-
canvas
Description copied from class:Plot
Returns a canvas of the plot.
-