mantispy.metrics.silhouette_label

mantispy.metrics.silhouette_label#

mantispy.metrics.silhouette_label(adata, label_key, use_rep='X_pca')#

How well separated the biological labels are, rescaled to [0, 1].

Higher means tighter, better separated groups.

Parameters:
  • adata (AnnData) – Object with the embedding to measure in.

  • label_key (str) – obs column with the biological grouping.

  • use_rep (str (default: 'X_pca')) – obsm key of the embedding.

Return type:

DataFrame

Returns:

A one-row tidy frame holding silhouette_label, whose value is NaN when separation is undefined for the object, which is when it holds one label or one row per label.

Raises:

KeyErrorobsm holds nothing under use_rep.