affin.prop | R Documentation |
Runs the Affinity Propagation clustering algorithm of Frey and Dueck, 2007.
affin.prop(
sim.mat,
num.iter = 100,
stable.iter = 10,
shared.pref = "min",
lambda = 0.5
)
sim.mat |
a similarity matrix between individuals to be clustered. |
num.iter |
maximum number of iterations to attempt. |
stable.iter |
number of sequential iterations for which consistent clustering is considered acceptable. |
shared.pref |
type of shared preference to use. Can be one of "min", "median", or a numeric value. |
lambda |
damping factor. |
A matrix with one row per sample in 'sim.mat' and one column for each iteration. Values in columns indicate cluster assignment (arbitrary numbers) for each sample.
Eric Archer eric.archer@noaa.gov
Frey, B.J., and D. Dueck. 2007. Clustering by passing messages between data points. Science 315:972-976
data(iris)
# Take 75 random iris rows for example
iris <- iris[sample(1:nrow(iris), 75), ]
iris <- droplevels(iris)
iris.sim <- -dist(iris[, -5])
iris.affin <- affin.prop(iris.sim, stable.iter = 5)
table(iris$Species, iris.affin[, ncol(iris.affin)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.