# BinaryF1Score#

class composer.metrics.BinaryF1Score(dist_sync_on_step=False)[source]#

Implements F1 Scores for binary classification tasks via sklearn.

true_positive (float): A counter of how many items were correctly classified as positives. false_positive (float): A counter of how many items were incorrectly classified as positives. false_negative (float): A counter of how many items were incorrectly classified as negatives.

Parameters

dist_sync_on_step (bool, optional) – Synchronize metric state across processes at each forward() before returning the value at the step. Default: False.

compute()[source]#

Aggregate the state over all processes to compute the metric.

Returns

loss – The loss averaged across all batches as a Tensor.

update(output, target)[source]#

Updates the internal state with results from a new batch.

Parameters
• output (Mapping) – The output from the model, which must contain either the Tensor or a Mapping type that contains the loss or model logits.

• target (Tensor) – A Tensor of ground-truth values to compare against.