Reference · The Applied Higher-Order Functions catalogue
rainbow.algorithms.proofs.ahof.accuracy
AHoF Classification Accuracy: the simplest evaluation metric -- the fraction of predictions that are correct, accuracy correct total = correct / total, a value in [0, 1]. It is the go-to score on balanced data (though misleading on imbalanced classes, where F1 or balanced accuracy are preferred). Defined: accuracy as exact rational division of the correct count by the total. Proved native and axiom-free, as worked instances: 3 correct of 4 gives accuracy 3/4, and 5 correct of 5 gives accuracy 1. That correct = total gives accuracy 1 for every total is not proved here. The prediction/label comparison is executable. Requires nnrat/divide (division is the rational-division capability, composed here), nnrat/equivalent, and the D63 checkpoint. Scope (measured by the kernel): this module has 2 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.accuracy` prints this classification.
accuracy/accuracy
accuracy/accuracy : (x₁ x₂ : ℚ≥0) → ℚ≥0
ℚ≥0 = nnrat/NonnegativeRational
accuracy/accuracy-example
accuracy/accuracy-example : → accuracy/accuracy 3 4 = 3/4
= = nnrat/equivalent: equality of rational values
accuracy/perfect-classifier-accuracy-one
accuracy/perfect-classifier-accuracy-one : → accuracy/accuracy 5 5 = 1
= = nnrat/equivalent: equality of rational values