moscot.problems.space.MappingProblem.compute_entropy¶
- MappingProblem.compute_entropy(source, target, forward=True, key_added='conditional_entropy', batch_size=None, c=1e-10, **kwargs)¶
Compute the conditional entropy per cell.
The conditional entropy reflects the uncertainty of the mapping of a single cell.
- Parameters:
forward (
bool
) – If True, computes the conditional entropy of a cell in the source distribution, else the conditional entropy of a cell in the target distribution.key_added (
Optional
[str
]) – Key inobs
where the entropy is stored.batch_size (
Optional
[int
]) – Batch size for the computation of the entropy. IfNone
, the entire dataset is used.c (
float
) – Constant added to each row of the transport matrix to avoid numerical instability.self (AnalysisMixinProtocol[K, B])
- Return type:
- Returns:
:
None
ifkey_added
is not None. Otherwise, returns a data frame of shape(n_cells, 1)
containing the conditional entropy per cell.