Computes the accuracy for binary classification problems where the
model returns probabilities. Commonly used when the loss is torch::nn_bce_loss().
Examples
if (torch::torch_is_installed()) {
library(torch)
metric <- luz_metric_binary_accuracy(threshold = 0.5)
metric <- metric$new()
metric$update(torch_rand(100), torch::torch_randint(0, 1, size = 100))
metric$compute()
}
#> [1] 0.49