Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.accuracy

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/accuracy.clj1 definitions, 2 theorems

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.

Depends onmath.rational.division

accuracy/accuracy

DefinitionSource, line 58

accuracy/accuracy :
  (x₁ x₂ : ℚ≥0)
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

accuracy/accuracy-example

TheoremWorked exampleNo axiomsSource, line 69

accuracy/accuracy-example :
  → accuracy/accuracy 3 4 = 3/4

= = nnrat/equivalent: equality of rational values

accuracy/perfect-classifier-accuracy-one

TheoremWorked exampleNo axiomsSource, line 75

accuracy/perfect-classifier-accuracy-one :
  → accuracy/accuracy 5 5 = 1

= = nnrat/equivalent: equality of rational values