Passer au contenu

Calcule la précision pour les problèmes de classification binaire pour un modèle avec des probabilités en sortie. Le plus souvent, associé à torch::nn_bce_loss().

Utilisation

luz_metric_binary_accuracy(threshold = 0.5)

Arguments

threshold

valeur de seuil pour classifier les observations en 0 ou 1.

Valeur de retour

Renvoie la nouvelle métrique luz.

Exemples

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()
}
#> Error in luz_metric_binary_accuracy(threshold = 0.5): impossible de trouver la fonction "luz_metric_binary_accuracy"