stereo.core.StPipeline.silhouette_score#

StPipeline.silhouette_score(cluster_res_key, metric='euclidean', sample_size=None, random_number=10086)[source]#

Calculate the mean Silhouette Coefficient for a cluster result.

Parameters:
  • cluster_res_key (str) – the key to get cluster result from cells, defaults to None

  • metric (str) – The metric to use when calculating distance between cells/bins based on exp_matrix, defaults to ‘euclidean’. It must be one of the options allowed by <sklearn.metrics.pairwise.pairwise_distances>.

  • sample_size (Optional[int]) – The size of the sample to use when computing the Silhouette Coefficient on a random subset of the data, if it is None, no sampling is used.

  • random_number (int) – random number for selecting a subset of samples, used when sample_size is not None, defaults to 10086, give fixed value in multiple calls for reproducible results.