Explore Library
Code QuizIntermediate

Accuracy From a Confusion Matrix

Spot the bug in a function computing accuracy from confusion matrix counts.

Codejavascript
function accuracy(TP, FP, FN, TN) {
  // accuracy = correct predictions / all predictions
  return (TP + TN) / (TP + FP + FN);
}

console.log(accuracy(50, 10, 5, 35));

What is the bug in this accuracy calculation?