Explore Library
Code QuizIntermediate

F1 Score Computation Bug

Spot why this F1 score formula is incorrect.

Codejavascript
function f1(precision, recall) {
  // F1 combines precision and recall
  return (precision + recall) / 2;
}

console.log(f1(0.8, 0.4));

What is the bug in this F1 score calculation?