Description Usage Arguments Value Note Examples
Convert an hdbscan object into a dendrogram compatible with the stats
package.
1 2 | ## S3 method for class 'hdbscan'
as.dendrogram(object, includeNodes = FALSE, ...)
|
object |
An |
includeNodes |
Whether individual nodes should be included in the dedrogram. Can cause a substantial increase in the size of the object. |
... |
For compatibility with |
A dendrogram
object, where nodes have the following attributes:
As in dendrogram
.
As in dendrogram
.
The number of nodes underneath the cluster.
The core distance at which the cluster or node was merged.
The probability that the leaf is a true member of its assigned cluster.
The leaf's GLOSH outlier score.
The node's determined stability, taking into account child-node stabilities. Missing for leaves.
Whether the node was selected as a cluster. Missing for leaves. Note that when a node is selected, all points under child branches are assigned to the same cluster.
The cluster number, for reference against the hdbscan
object.
The hdbscan algorithm works by first building a hierarchy based on a minimal spanning tree, then consolidating nodes according to rules in the algorithm. The algorithm then selects some of the consolidated nodes as clusters, deselecting others. For example, if Node A has children B and C, the algorithm might select A, and then all points under A, B, and C would be assigned to the same cluster. Or, it might deselect A, and select B and C instead. In that case, the nodes under B would be assigned to one cluster, the nodes under C to a different cluster, and nodes under A but not B or C would not be assigned to any cluster. This function returns a dendrogram of the middle stage, the hierarchy of consolidated nodes. Whether a node was selected as as cluster is an attribute of each node.
This function remains experimental in terms of finding the best way to represent an hdbscan object in a dendrogram.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.