Learn R Programming

apcluster (version 1.4.11)

preferenceRange: Determine Meaningful Ranges for Input Preferences

Description

Determines meaningful ranges for affinity propagation input preference

Usage

# S4 method for matrix
preferenceRange(s, exact=FALSE)
# S4 method for Matrix
preferenceRange(s, exact=FALSE)
# S4 method for dgTMatrix
preferenceRange(s, exact=FALSE)
# S4 method for sparseMatrix
preferenceRange(s, exact=FALSE)

Value

returns a vector with two entries, the first of which is the minimal input preference (which would lead to 1 or 2 clusters) and the second of which is the maximal input prefence (which would lead to as many clusters as data samples).

Arguments

s

an \(l\times l\) similarity matrix in sparse or dense format

exact

flag indicating whether exact ranges should be computed, which is relatively slow; if bounds are sufficient, supply FALSE (default)

Author

Ulrich Bodenhofer & Andreas Kothmeier apcluster@bioinf.jku.at

Details

Affinity Propagation clustering relies on an appropriate choice of input preferences. This function helps in finding a good choice by determining meaningful lower and upper bounds.

If the similarity matrix s is sparse or if it contains -Inf similarities, only the similarities are taken into account that are specified in s and larger than -Inf. In such cases, the lower bound returned by preferenceRange need not correspond to one or two clusters. Moreover, it may also happen in degenerate cases that the lower bound exceeds the upper bound. In such a case, no warning or error is issued, so it is the user's responsibility to ensure a proper interpretation of the results. The method apclusterK makes use of this function internally and checks the plausibility of the result returned by preferenceRange.

References

http://www.bioinf.jku.at/software/apcluster/

Frey, B. J. and Dueck, D. (2007) Clustering by passing messages between data points. Science 315, 972-976. DOI: tools:::Rd_expr_doi("10.1126/science.1136800").

Bodenhofer, U., Kothmeier, A., and Hochreiter, S. (2011) APCluster: an R package for affinity propagation clustering. Bioinformatics 27, 2463-2464. DOI: tools:::Rd_expr_doi("10.1093/bioinformatics/btr406").

See Also

apcluster

Examples

Run this code
## create two Gaussian clouds
cl1 <- cbind(rnorm(100, 0.2, 0.05), rnorm(100, 0.8, 0.06))
cl2 <- cbind(rnorm(50, 0.7, 0.08), rnorm(50, 0.3, 0.05))
x <- rbind(cl1, cl2)

## create similarity matrix
sim <- negDistMat(x, r=2)

## determine bounds
preferenceRange(sim)

## determine exact range
preferenceRange(sim, exact=TRUE)

Run the code above in your browser using DataLab