c2v.pl.loss_history

Contents

c2v.pl.loss_history#

c2v.pl.loss_history(clones, uns_key='clone2vec', return_fig=False, loss_key='loss_history', show=True, figsize=None, ax=None)#

Plot the mean loss per epoch and its change across epochs during clone2vec training.

Parameters:
clones AnnData

Annotated data matrix containing training statistics in clones.uns.

uns_key str, optional

Key in clones.uns that stores a list of mean losses per epoch. Default is “c2v_loss_history”.

loss_key str, optional

Key in clones.uns[uns_key] that stores a list of mean losses per epoch. Default is “loss_history”.

return_fig bool, optional

If True, returns the Matplotlib Figure object. Default is False.

show bool, optional

If True, shows the plot. Default is True.

figsize tuple[float, float] | None, optional

Figure size. Default is None.

ax list[matplotlib.axes.Axes] | None, optional

List of axes to plot on. Default is None.

Return type:

Figure | list[Axes] | None

Returns:

None or matplotlib.figure.Figure or list[matplotlib.axes.Axes] The plot figure if return_fig is True, or axes if return_ax is True, otherwise None.

Raises:

KeyError – If uns_key is not present in clones.uns.