adelie.diagnostic.plot_kkt#
- adelie.diagnostic.plot_kkt(lmdas: ndarray, scores: ndarray, *, idx: int | None = None, relative: bool = False)[source]#
Plots KKT failures.
This function only plots a subset of the scores. Specifically (assuming
idxis notNone), if there arennumber of scores inscores[idx]above the thresholdlmdas[idx], then thesenscores as well as thenlargest scores below the threshold are shown. IfidxisNone, then the same plot is drawn at every index as an animation.- Parameters:
- lmdas(L,) ndarray
Regularization parameters \(\lambda\).
- scores(L, G) ndarray
Gradient scores.
- idxint, optional
Index of
lmdasandscoresat which to plot the KKT failures. IfNone, then an animation of the plots at every index is shown. Default isNone.- relativebool, optional
If
True, then plots the relative errorscore / lmda[:, None] - 1. Otherwise, the absolute values are used. Default isFalse.
- Returns:
- fig, ax
If
idxis notNone, then a figure and axes is returned.- anim
If
idxisNone, then an animation of the plots is returned.