Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hcRandomPairs

Random hierarchical structure


Description

Create a hierarchical structure using a random hierarchical partition of the data.

Usage

hcRandomPairs(data, seed = NULL, ...)

Arguments

data

A numeric matrix or data frame of observations. If a matrix or data frame, rows correspond to observations and columns correspond to variables.

seed

Optional single value, interpreted as an integer, specifying the seed for random partition.

...

Catches unused arguments in indirect or list calls via do.call.

Value

A numeric two-column matrix in which the ith row gives the minimum index for observations in each of the two clusters merged at the ith stage of a random agglomerative hierarchical clustering.

See Also

Examples

data <- iris[,1:4]
randPairs <- hcRandomPairs(data)
str(randPairs)
# start model-based clustering from a random partition
mod <- Mclust(data, initialization = list(hcPairs = randPairs))
summary(mod)

mclust

Gaussian Mixture Modelling for Model-Based Clustering, Classification, and Density Estimation

v5.4.10
GPL (>= 2)
Authors
Chris Fraley [aut], Adrian E. Raftery [aut] (<https://orcid.org/0000-0002-6589-301X>), Luca Scrucca [aut, cre] (<https://orcid.org/0000-0003-3826-0484>), Thomas Brendan Murphy [ctb] (<https://orcid.org/0000-0002-5668-7046>), Michael Fop [ctb] (<https://orcid.org/0000-0003-3936-2757>)
Initial release
2022-05-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.