scvi.core.utils.DifferentialComputation.scale_sampler

DifferentialComputation.scale_sampler(selection, n_samples=5000, n_samples_per_cell=None, batchid=None, use_observed_batches=False, give_mean=False)[source]

Samples the posterior scale using the variational posterior distribution.

Parameters
selection : List[bool], ndarrayUnion[List[bool], ndarray]

Mask or list of cell ids to select

n_samples : int, NoneOptional[int] (default: 5000)

Number of samples in total per batch (fill either n_samples_total or n_samples_per_cell)

n_samples_per_cell : int, NoneOptional[int] (default: None)

Number of time we sample from each observation per batch (fill either n_samples_total or n_samples_per_cell)

batchid : Sequence[Union[int, float, str]], NoneOptional[Sequence[Union[int, float, str]]] (default: None)

Biological batch for which to sample from. Default (None) sample from all batches

use_observed_batches : bool, NoneOptional[bool] (default: False)

Whether normalized means are conditioned on observed batches or if observed batches are to be used

give_mean : bool, NoneOptional[bool] (default: False)

Return mean of values

Return type

dictdict

Returns

type Dictionary containing: scale Posterior aggregated scale samples of shape (n_samples, n_vars) where n_samples correspond to either: - n_bio_batches * n_cells * n_samples_per_cell or - n_samples_total batch associated batch ids