scvi.model.AmortizedLDA.get_perplexity

AmortizedLDA.get_perplexity(adata=None, indices=None, batch_size=None)[source]

Computes approximate perplexity for adata.

Perplexity is defined as exp(-1 * log-likelihood per count).

Parameters
adata : AnnData | NoneOptional[AnnData] (default: None)

AnnData object with equivalent structure to initial AnnData. If None, defaults to the AnnData object used to initialize the model.

indices : Sequence[int] | NoneOptional[Sequence[int]] (default: None)

Indices of cells in adata to use. If None, all cells are used.

batch_size : int | NoneOptional[int] (default: None)

Minibatch size for data loading into model. Defaults to scvi.settings.batch_size.

Return type

floatfloat

Returns

Perplexity.