scib_metrics.utils.silhouette_samples

scib_metrics.utils.silhouette_samples#

scib_metrics.utils.silhouette_samples(X, labels, chunk_size=256)[source]#

Compute the Silhouette Coefficient for each observation.

Implements sklearn.metrics.silhouette_samples().

Parameters:
  • X (ndarray) – Array of shape (n_cells, n_features) representing a feature array.

  • labels (ndarray) – Array of shape (n_cells,) representing label values for each observation.

  • chunk_size (int (default: 256)) – Number of samples to process at a time for distance computation.

Return type:

ndarray

Returns:

silhouette scores array of shape (n_cells,)