Learn R Programming

salso (version 0.1.9)

psm: Compute the Pairwise Similarity Matrix

Description

This function computes the n-by-n matrix whose (i,j) element gives the (estimated) probability that items i and j are in the same subset (i.e., cluster).

Usage

psm(x, parallel = TRUE)

Arguments

x

A B-by-n matrix, where each of the B rows represents a clustering of n items using cluster labels. For clustering b, items i and j are in the same cluster if x[b,i] == x[b,j].

parallel

Should the computation use all CPU cores?

Value

A n-by-n symmetric matrix whose (i,j) element gives the estimated expected number of times that items i and j are in the same subset (i.e., cluster or feature) based on the frequencies from the supplied clusterings or feature allocations.

Examples

Run this code
# NOT RUN {
dim(iris.clusterings)
probs <- psm(iris.clusterings, parallel=FALSE)
dim(probs)
probs[1:6, 1:6]

# }

Run the code above in your browser using DataLab