smile.plot
Class Dendrogram
- java.lang.Object
-
- smile.plot.Shape
-
- smile.plot.Plot
-
- smile.plot.Dendrogram
-
public class Dendrogram extends Plot
A dendrogram is a tree diagram frequently used to illustrate the arrangement of the clusters produced by hierarchical clustering.
-
-
Constructor Summary
Constructors Constructor and Description Dendrogram(int[][] merge, double[] height)Constructor.Dendrogram(int[][] merge, double[] height, java.awt.Color color)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetHeight()Returns the height of tree.voidpaint(Graphics g)Draw the component with given graphics object.static PlotCanvasplot(int[][] merge, double[] height)Create a dendrogram plot.static PlotCanvasplot(java.lang.String id, int[][] merge, double[] height)Create a dendrogram plot.-
Methods inherited from class smile.plot.Plot
getID, getToolBar, getToolTip, setID
-
-
-
-
Constructor Detail
-
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. If j ≥ 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
public Dendrogram(int[][] merge, double[] height, java.awt.Color color)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. If j ≥ 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 Detail
-
getHeight
public double getHeight()
Returns the height of tree.
-
paint
public void paint(Graphics g)
Description copied from class:ShapeDraw the component with given graphics object.
-
plot
public static PlotCanvas plot(int[][] merge, double[] height)
Create a dendrogram plot.- 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. If j ≥ 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.
-
plot
public static PlotCanvas plot(java.lang.String id, int[][] merge, double[] height)
Create a dendrogram plot.- Parameters:
id- the id of the plot.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. If j ≥ 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG