Learn R Programming

largeVis (version 0.2.1.1)

as.dendrogram.hdbscan: as.dendrogram.hdbscan

Description

Convert an hdbscan object into a dendrogram compatible with the stats package.

Usage

# S3 method for hdbscan
as.dendrogram(object, includeNodes = FALSE, ...)

Arguments

object

An hdbscan object.

includeNodes

Whether individual nodes should be included in the dedrogram. Can cause a substantial increase in the size of the object.

...

For compatibility with as.dendrogram, and currently ignored.

Value

A dendrogram object, where nodes have the following attributes:

'leaf'

As in dendrogram.

'members'

As in dendrogram.

'size'

The number of nodes underneath the cluster.

'height'

The core distance at which the cluster or node was merged.

'probability'

The probability that the leaf is a true member of its assigned cluster.

'GLOSH'

The leaf's GLOSH outlier score.

'stability'

The node's determined stability, taking into account child-node stabilities. Missing for leaves.

'selected'

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.

'cluster'

The cluster number, for reference against the hdbscan object.

Examples

Run this code
# NOT RUN {
data(iris)
vis <- largeVis(t(iris[,1:4]), K = 20, sgd_batches = 1, threads = 1)
hdbscanobj <- hdbscan(vis, minPts = 10, K = 5)
plot(as.dendrogram(hdbscanobj))
# }

Run the code above in your browser using DataLab