matchzoo.engine.base_metric¶
Metric base class and some related utilities.
Module Contents¶
-
class
matchzoo.engine.base_metric.BaseMetric¶ Bases:
abc.ABCMetric base class.
-
ALIAS= base_metric¶
-
__call__(self, y_true: np.array, y_pred: np.array)¶ Call to compute the metric.
Parameters: - y_true – An array of groud truth labels.
- y_pred – An array of predicted values.
Returns: Evaluation of the metric.
-
__repr__(self)¶ Returns: Formated string representation of the metric.
-
__eq__(self, other)¶ Returns: True if two metrics are equal, False otherwise.
-
__hash__(self)¶ Returns: Hashing value using the metric as str.
-
-
class
matchzoo.engine.base_metric.RankingMetric¶ Bases:
matchzoo.engine.base_metric.BaseMetricRanking metric base class.
-
ALIAS= ranking_metric¶
-
-
class
matchzoo.engine.base_metric.ClassificationMetric¶ Bases:
matchzoo.engine.base_metric.BaseMetricRangking metric base class.
-
ALIAS= classification_metric¶
-
-
matchzoo.engine.base_metric.sort_and_couple(labels: np.array, scores: np.array) → np.array¶ Zip the labels with scores into a single list.