Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-401

Accuracy from Confusion Counts

Problem

Classification accuracy is (TP + TN) / (TP + TN + FP + FN).

Given the four counts, return the accuracy.

Hint

Correct predictions over all predictions.

Test cases

case 1
in: [8,9,1,2]
expected: 0.85
case 2
in: [5,5,0,0]
expected: 1
case 3
in: [0,0,1,1]
expected: 0
Starter codePython
def accuracy_from_confusion_counts(tp, tn, fp, fn):
    # Your code here
    pass

3 test cases · run your code against them in the editor