Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.svm

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

AHoF Support Vector Machine (linear, hard-margin classification): find the hyperplane that separates two classes with the MAXIMUM margin, then classify a point by which side it falls on. Training maximizes the margin subject to every example satisfying y_i (w.x_i - b) >= 1; at prediction time, a point is assigned the positive class when its functional margin reaches the decision boundary: classify-positive? margin threshold = decide (threshold <= margin) where margin = w.x - b and threshold = 0 for the decision, or 1 for the confident-margin band, over exact-rational margins. Proved native and axiom-free: the side-of-hyperplane decision; that a point on the positive side is classified positive; the certificate that a point classified confident-positive really has functional margin at least 1 (native nnrat/at-most) -- the max-margin constraint; and that a point below the boundary is classified negative. The weight vector, bias, and dot product are executable; what is proved is the margin decision. Requires nnrat/at-most, audit/decide-nnrat-at-most, nnrat/decide-at-most-true-sound (all in the D63 checkpoint). Scope (measured by the kernel): this module has 3 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.svm` prints this classification.

svm/classify-positive?

DefinitionSource, line 59

svm/classify-positive? :
  (x₁ x₂ : ℚ≥0)
  → data/Bool

ℚ≥0 = nnrat/NonnegativeRational

svm/positive-side-classified-positive

TheoremWorked exampleNo axiomsSource, line 70

svm/positive-side-classified-positive :
  → bo/is-safe 2 0 = data/true

= = equality/Eq

svm/confident-margin-at-least-one

TheoremWorked exampleNo axiomsSource, line 79

svm/confident-margin-at-least-one :
  → 1 ≤ 2

≤ = nnrat/at-most

svm/inside-margin-not-confident

TheoremWorked exampleNo axiomsSource, line 86

svm/inside-margin-not-confident :
  → bo/is-safe 0 1 = data/false

= = equality/Eq