modulation.classification.metrics.lwlrap.lwlrap_accumulator¶
- class modulation.classification.metrics.lwlrap.lwlrap_accumulator[source]¶
Bases:
object
Accumulate batches of test samples into per-class and overall lwlrap.
Methods
__init__
()accumulate_samples
(batch_truth, batch_scores)Cumulate a new batch of samples into the metric.
Return the scalar overall lwlrap for cumulated samples.
Return a vector of the per-class lwlraps for the accumulated samples.
Return a normalized weight vector for the contributions of each class.
- accumulate_samples(batch_truth, batch_scores)[source]¶
Cumulate a new batch of samples into the metric.
- Parameters
truth – numpy.array of (num_samples, num_classes) giving boolean ground-truth of presence of that class in that sample for this batch.
scores – numpy.array of (num_samples, num_classes) giving the classifier-under-test’s real-valued score for each class for each sample.