psm | R Documentation |
If only one sample is provided, this function computes an adjacency matrix,
i.e., a binary matrix whose (i,j)
element is one if and only if
elements i
and j
in the partition have the same cluster label. If
multiple samples are provided (as rows of the x
matrix), this function
computes the n
-by-n
matrix whose (i,j)
element gives the
relative frequency (i.e., estimated probability) that items i
and
j
are in the same subset (i.e., cluster). This is the mean of the
adjacency matrices of the provided samples.
psm(x, nCores = 0)
x |
A |
nCores |
The number of CPU cores to use, i.e., the number of simultaneous runs at any given time. A value of zero indicates to use all cores on the system. |
A n
-by-n
symmetric matrix whose (i,j)
element gives
the relative frequency that that items i
and j
are in the same
subset (i.e., cluster).
# For examples, use 'nCores=1' per CRAN rules, but in practice omit this.
data(iris.clusterings)
partition <- iris.clusterings[1,]
psmatrix <- psm(partition, nCores=1)
psmatrix[1:6, 1:6]
dim(iris.clusterings)
probs <- psm(iris.clusterings, nCores=1)
dim(probs)
probs[1:6, 1:6]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.