cafaeval.tests

Runtime invariant checks used by the dense partial-knowledge kernel to guard against impossible confusion-matrix states (metrics outside [0, 1], intersections larger than either operand).

cafaeval.tests.test_norm_metric(metric, name=None)[source]

Test if metric is between 0 and 1 :param metric: array of metric to test :param name: string of metric name for error message if necessary

cafaeval.tests.test_intersection(intersection, pred_counts, true_counts)[source]

Test if intersection of counts is always smaller than counts from one method :param intersection: array of positive counts in intersection :param pred_counts: array of positive counts from prediction :param true_counts: array of positive counts from ground truth