Explore Library
Code QuizIntermediate

Precision Calculation Bug

Find the mistake in a function that computes precision.

Codejavascript
function precision(TP, FP, FN) {
  // precision = of predicted positives, how many are correct
  return TP / (TP + FN);
}

console.log(precision(80, 20, 10));

What is the bug in this precision function?