src/proteingnn/util.py
def confusion_matrix_plot(cm: np.array, return_fig: bool = True) -> Union[Figure, Axes]:
    """Utility function get plot confusion matrix ax or figure.

    Args:
        cm: Confusion matrix in numpy.Array.
        return_fig: If true, return matplotlib.Figure. Otherwise, matplotlib.Axes
    """
    display = ConfusionMatrixDisplay(cm)
    _ = display.plot()
    plt.close()
    display.ax_.grid(False)

    if return_fig:
        return display.figure_
    else:
        return display.ax_
Utility function get plot confusion matrix ax or figure.

    Args:
        cm: Confusion matrix in numpy.Array.
        return_fig: If true, return matplotlib.Figure. Otherwise, matplotlib.Axes
    
Utility function get plot confusion matrix ax or figure.
Utility function get plot confusion matrix ax or figure .
def confusion_matrix_plot(cm: np.array, return_fig: bool = True) -> Union[Figure, Axes]:
    display = ConfusionMatrixDisplay(cm)
    _ = display.plot()
    plt.close()
    display.ax_.grid(False)
    if return_fig:
        return display.figure_
    else:
        return display.ax_
def confusion_matrix_plot ( cm : np . array , return_fig : bool = True ) -> Union [ Figure , Axes ] : display = ConfusionMatrixDisplay ( cm ) _ = display . plot ( ) plt . close ( ) display . ax_ . grid ( False ) if return_fig : return display . figure_ else : return display . ax_
Utility function get plot confusion matrix ax or figure.
Utility function get plot confusion matrix ax or figure .
"""Utility function get plot confusion matrix ax or figure.

    Args:
        cm: Confusion matrix in numpy.Array.
        return_fig: If true, return matplotlib.Figure. Otherwise, matplotlib.Axes
    """
cm
np.array
Confusion matrix in numpy.Array.
Confusion matrix in numpy . Array .
return_fig
bool
If true, return matplotlib.Figure. Otherwise, matplotlib.Axes
If true return matplotlib . Figure . Otherwise matplotlib . Axes