neuro_morpho.model.metrics ========================== .. py:module:: neuro_morpho.model.metrics .. autoapi-nested-parse:: Evaluation metrics for model performance. Attributes ---------- .. autoapisummary:: neuro_morpho.model.metrics.PRED neuro_morpho.model.metrics.LBL neuro_morpho.model.metrics.METRIC_FN Functions --------- .. autoapisummary:: neuro_morpho.model.metrics.accuracy neuro_morpho.model.metrics.class_accuracy Module Contents --------------- .. py:data:: PRED .. py:data:: LBL .. py:data:: METRIC_FN .. py:function:: accuracy(pred: PRED, lbl: LBL, threshold: float) -> tuple[str, float] Calculate the accuracy of predictions. :param pred: The predicted labels. :type pred: np.ndarray :param lbl: The true labels. :type lbl: np.ndarray :param threshold: The threshold for binary classification. :type threshold: float :returns: A tuple containing the metric name and the accuracy value. :rtype: tuple[str, float] .. py:function:: class_accuracy(pred: PRED, lbl: LBL, class_idx: int, threshold: float) -> tuple[str, float] Calculate the class-wise accuracy of predictions. :param pred: The predicted labels. :type pred: np.ndarray :param lbl: The true labels. :type lbl: np.ndarray :param class_idx: The class index to calculate accuracy for. :type class_idx: int :param threshold: The threshold for binary classification. :type threshold: float :returns: A tuple containing the metric name and the class-wise accuracy value. :rtype: tuple[str, float]