sparseToFull: Convert a Sparse Similarity Matrix to Standard Representation
Description
Converts a similarity matrix in sparse format to a full l by l matrix
Usage
sparseToFull(s, fill=-Inf)
Arguments
s
a similarity matrix in sparse format; s must have exactly
three columns; the matrix
interpreted as follows: assume that a given row contains an
integer index i in the 1st column and an integer index j
in the 2nd
fill
value to fill in for entries not specified in s
Value
returns a square similarity matrix
Details
Frey's and Dueck's implementation can handle
$l\times l$ similarity
matrices and similarity matrices of the sparse format described above.
Presently our implementation does not make any use of the sparsity of
the similarity matrix. The functions apcluster,
apclusterK, and preferenceRange,
therefore, only accept square similarity matrices. This function
is a utility for converting sparse similarity matrices - wherever
they may come from.
Note that most of Frey's and Dueck's Matlab functions make an internal
conversion. Guessing the right format from the matrix's dimension may
be wrong for $3\times 3$ matrices.
We avoid this problem by explicitly
distinguishing between sparse and dense similarity matrices (although
we admit that clustering of 3 values makes as little sense as
considering similarity matrices with only three entries).
References
http://www.bioinf.jku.at/software/apcluster
Frey, B. J. and Dueck, D. (2007) Clustering by passing messages
between data points. Science315, 972-976.
DOI: http://dx.doi.org/10.1126/science.1136800{10.1126/science.1136800}.
Bodenhofer, U., Kothmeier, A., and Hochreiter, S. (2011)
APCluster: an R package for affinity propagation clustering.
Bioinformatics27, 2463-2464.
DOI: http://dx.doi.org/10.1093/bioinformatics/btr406{10.1093/bioinformatics/btr406}.