qbiocode.apps.quvine.analysis.analyze module#
Summary#
Functions:
Plot the log singular-value spectrum, optionally writing it to |
|
Singular-value spectra and effective ranks for a list of embeddings. |
Reference#
- plot_singular_values(singular_values, label='concatenate', filename=None, show=False)[source]#
Plot the log singular-value spectrum, optionally writing it to
filename.- Parameters:
singular_values – Singular values in descending order.
label – Legend label for the series.
filename – Where to write the figure; nothing is written when
None.show – Whether to call
plt.show(). Defaults toFalsebecause this is library code – under a GUI backendshowblocks until a human closes the window, and it is ignored under a non-interactive one.
- Returns:
the figure, already closed but still savable.
- Return type:
matplotlib.figure.Figure
- spectral_info(embeddings, labels, plot_flag=False, outdir='.', show=False)[source]#
Singular-value spectra and effective ranks for a list of embeddings.
- Parameters:
embeddings – Embedding matrices to compare.
labels – One label per embedding, used in the legend and the result keys.
plot_flag – Whether to draw and write the three spectrum figures.
outdir – Directory the figures are written to. Previously they went to the process’s current working directory under fixed names, so two runs from the same directory silently overwrote each other’s plots.
show – Whether to call
plt.show(); seeplot_singular_values().
- Returns:
{label: effective_rank}.- Return type:
dict