:py:mod:`kosmos.ml.sl_metrics` ============================== .. py:module:: kosmos.ml.sl_metrics Classes ------- .. py:class:: SLMetrics Supervised learning classification evaluation metrics. .. attribute:: accuracy Overall classification accuracy. :type: float .. attribute:: precision Macro-averaged precision across classes. :type: float .. attribute:: recall Macro-averaged recall across classes. :type: float .. attribute:: f1 Macro-averaged F1 score across classes. :type: float Functions --------- .. py:function:: calculate_sl_metrics(y_true: numpy.ndarray, y_pred: numpy.ndarray) -> SLMetrics Calculate supervised learning classification metrics for a given prediction. :param y_true: Ground-truth labels. :type y_true: ndarray :param y_pred: Predicted labels. :type y_pred: ndarray :returns: Evaluation metrics. :rtype: SLMetrics