relabel_true_log | R Documentation |
Relabels the membership vectors of a mixed membership model or mixed membership stochastic blockmodel, by minimizing the KL-divergence to a priori known true labels, where probabilities are entered on the log-scale.
relabel_true_log(
lphi,
lphi_true,
renormalize = FALSE,
nthreads = 0L,
verbose = FALSE
)
lphi |
cube of length |
lphi_true |
a |
renormalize |
whether to renormalize the rows of |
nthreads |
number of threads to use if OPENMP is enabled |
verbose |
if true, KL-divergence from true labels is calculated and printed before and after relabeling |
OpenMP is enabled if available. Due to overhead, the inner-most loop is parallelized only if the number of latent classes/types is larger than 3.
Returns a Rcpp::List with two elements: 1) A arma::cube,
permuted
, of the same dimensions as phi
but
with the labels permuted; 2) perms
is a S
times K
matrix containing the permutations necessary to produce permuted
from phi
(i.e., the mapping from phi
to permuted
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.