stereoAlign.metrics.silhouette

stereoAlign.metrics.silhouette(adata, label_key, embed, metric='euclidean', scale=True)[source]

Average silhouette width (ASW)

Wrapper for sklearn silhouette function values range from [-1, 1] with

  • 1 indicates distinct, compact clusters

  • 0 indicates overlapping clusters

  • -1 indicates core-periphery (non-cluster) structure

By default, the score is scaled between 0 and 1 (scale=True).

Parameters

label_key:

key in adata.obs of cell labels

embed:

embedding key in adata.obsm, default: ‘X_pca’

metric:

type of distance metric to use for the silhouette scores

scale:

default True, scale between 0 (worst) and 1 (best)

The function requires an embedding to be stored in adata.obsm and can only be applied to feature and embedding integration outputs. Please note, that the metric cannot be used to evaluate kNN graph outputs.