partipy.plot_var_explained

partipy.plot_var_explained#

partipy.plot_var_explained(adata, ymin=None, ymax=None, result_filters=None)#

Generate an elbow plot of the variance explained by Archetypal Analysis (AA) for a range of archetypes.

This function creates a plot showing the variance explained by AA models with different numbers of archetypes. Cached selection metrics are summarized on demand. Selection metrics must be computed beforehand via compute_selection_metrics().

Parameters:
  • adata (anndata.AnnData) – AnnData object containing cached selection metrics in adata.uns["AA_selection_metrics"].

  • ymin (None | float)

  • ymax (None | float) – specify y

  • result_filters (Mapping[str, Any] | None, default None) – Optional filters applied to ArchetypeConfig entries when summarizing cached metrics.

Return type:

ggplot

Returns:

pn.ggplot A ggplot object showing the variance explained plot.