modulation.classification.metrics.lwlrap.one_sample_positive_class_precisions¶
- modulation.classification.metrics.lwlrap.one_sample_positive_class_precisions(scores: array, truths: array) array [source]¶
Reference implementation of l$omega$lrap both natively and using sklearn.metrics.
Calculate precisions for each true class for a single sample.
- Args:
scores: numpy.array of (num_classes,) giving the individual classifier scores. truths: numpy.array of (num_classes,) bools indicating which classes are true.
- Returns:
pos_class_indices: numpy.array of indices of the true classes for this sample. pos_class_precisions: numpy.array of precisions corresponding to each of those
classes.