Learn R Programming

celda (version 0.0.0.9000)

calculatePerplexityWithResampling: Calculate and visualize perplexity of all models in a celda_list, with resampling

Description

Calculates the perplexity (a measure of how well celda's cluster assignments fit the data) for every celda model in a celda_list generated by the celda() function. Perplexity of the cluster assignments given the provided count matrix, as well as resamplings of that count matrix, provide a distribution of perplexities and a better sense of the quality of a given K/L choice.

Usage

calculatePerplexityWithResampling(celda.list, counts, resample, title = "")

Arguments

celda.list

A celda_list object as returned from *celda()*

counts

The counts matrix used to generate the provided celda.list

resample

The number of times to resample the counts matrix for evaluating perplexity. Works with method="perplexity."

title

Title to be appended to the perplexity plot title. Default is "".

Value

A list with a data frame summarizing all of the calculated perplexities, and a ggplot2 object visualizing them.