struct HClust::Dendrogram::Step
- HClust::Dendrogram::Step
- Struct
- Value
- Object
Overview
A single merge step in a dendrogram.
A step corresponds to a merge between two distinct clusters. By
convention, the indexes of the merged clusters (#nodes
) are always
sorted.
Defined in:
hclust/dendrogram.crConstructors
-
.new(c_i : Int32, c_j : Int32, distance : Float64)
Creates a new Step between the clusters c_i and c_j with the given distance.
Instance Method Summary
-
#==(rhs : self) : Bool
Returns
true
if the step are equal, elsefalse
. -
#clusters : Tuple(Int32, Int32)
Indexes of the merged clusters.
-
#distance : Float64
Distance between the merged clusters.
-
#sqrt : self
Returns a
Step
with the square root of the distance.
Constructor Detail
Creates a new Step between the clusters c_i and c_j with the given distance.
NOTE Cluster indexes are stored sorted.
Instance Method Detail
Returns true
if the step are equal, else false
.
NOTE Distances are compared within numeric precision (epsilon = 1e-15).
Indexes of the merged clusters. An index can range from 0 to N +
N - 1, where N is the number of original elements or
observations and an index equals to or greater than N indicates
a newly created cluster (refer to the Dendrogram
documentation).