ladder.scripts.metrics.kmeans_nmi

Contents

ladder.scripts.metrics.kmeans_nmi#

ladder.scripts.metrics.kmeans_nmi(anndata, test_for, embed)#

Calculates the K-Means NMI for latent representations.

The K-Means clustering in the latents is compared with the labels originally appearing in AnnData.

Parameters:
  • anndata (AnnData) – The anndata object provided.

  • test_for (str) – Factor column in obs for the original labels.

  • embed (str) – Key in obsm pointing to the embeddings to run K-Means with.

Returns:

float NMI for original labels and K-Means clusters.