diff --git a/docs/posts/classification-metrics-on-the-backend/index.qmd b/docs/posts/classification-metrics-on-the-backend/index.qmd index 72b3ac9f35ac..a02623540c70 100644 --- a/docs/posts/classification-metrics-on-the-backend/index.qmd +++ b/docs/posts/classification-metrics-on-the-backend/index.qmd @@ -186,7 +186,7 @@ fp = t.prediction.sum() - tp fn = t.actual.sum() - tp tn = t.actual.count() - tp - fp - fn -accuracy_expr = (tp + tn) / (tp + tn + fp + fn) +accuracy_expr = (t.actual == t.prediction).mean() precision_expr = tp / t.prediction.sum() recall_expr = tp / t.actual.sum() f1_score_expr = 2 * tp / (t.actual.sum() + t.prediction.sum())