mantispy.metrics.silhouette_batch#
- mantispy.metrics.silhouette_batch(adata, label_key, batch_key, use_rep='X_pca')#
How well mixed the batches are within each biological label.
Computed per label as
1 - mean|silhouette over batch|and averaged over labels. Higher is better; a silhouette near zero means the batches are indistinguishable within that label.A label is skipped when mixing is undefined for it, which is when it has fewer than two batches or as many batches as rows (one well per plate on three plates, for example).
- Parameters:
- Return type:
- Returns:
A one-row tidy frame holding
silhouette_batch, whose value is NaN when every label was skipped.- Raises:
KeyError –
obsmholds nothing underuse_rep.