Cslib.MachineLearning.PACLearning.error
defimported Lean
The *prediction error* (0-1 loss) of a hypothesis h under a joint distribution D on α × β, defined as the probability that the prediction disagrees with the label: D({(x, y) | h(x) ≠ y}).
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open MeasureTheory Set in open scoped ENNReal NNReal in variable {α : Type*} {β : Type*} [MeasurableSpace α] [MeasurableSpace β] in noncomputable def Cslib.MachineLearning.PACLearning.error (D : Measure (α × β)) (h : α → β) : ℝ≥0∞
- Defined in
- CSLib, `Cslib.MachineLearning.PACLearning.error`
- Lean proof
- By Samuel Schlesinger, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2026 Samuel Schlesinger. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.MachineLearning.PACLearning.error← Cslib.MachineLearning.PACLearning.error (Cslib/MachineLearning/PACLearning/Defs.lean:137): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Used by 14
- Cslib.MachineLearning.PACLearning.IsPACLearnerFor
IsPACLearnerFor m ε δ C 𝒟asserts that there exists a learner usingmsamples that is(ε, δ)-correct for the concept classCover… - Cslib.MachineLearning.PACLearning.IsRPACLearnerFor.antitone_familyThe randomized PAC learner predicate is antitone in the distribution family. The universe of the randomness space
Ωis pinned so the… - Cslib.MachineLearning.PACLearning.optimalErrorThe *optimal error* of a concept class
Cunder a joint distributionD, defined as the infimum oferror D cover all concepts… - Cslib.MachineLearning.PACLearning.IsPACLearnerFor.antitone_familyThe deterministic PAC learner predicate is antitone in the distribution family: a learner for a larger family
𝒟'is also a learner for… - Cslib.MachineLearning.PACLearning.empiricalErrorThe *empirical 0-1 error* of
honS: the empirical distribution's mass on the disagreement set. - Cslib.MachineLearning.PACLearning.empiricalError_eq_divThe empirical 0-1 error equals the empirical miscount divided by the sample size.
- Cslib.MachineLearning.PACLearning.IsRPACLearnerFor.mono_δA randomized PAC learner with confidence
δ₁is also a randomized PAC learner with any weaker confidenceδ₂ ≥ δ₁. Unlikemono_εor… - Cslib.MachineLearning.PACLearning.IsPACLearnerFor.mono_δA PAC learner with confidence
δ₁is also a PAC learner with any weaker confidenceδ₂ ≥ δ₁: the failure-probability bound only gets… - Cslib.MachineLearning.PACLearning.mem_versionSpace_iff_empiricalError_zeroVersion-space membership equals concept-class membership plus zero empirical error (measure-theoretic bridge).
- Cslib.MachineLearning.PACLearning.IsRPACLearnerFor
IsRPACLearnerFor m ε δ C 𝒟asserts that there exists a *randomized* learner usingmsamples that is(ε, δ)-correct for the concept… - Cslib.MachineLearning.PACLearning.IsPACLearnerFor.mono_εA PAC learner with accuracy
ε₁is also a PAC learner with any weaker accuracyε₂ ≥ ε₁: the bad event{error > opt + ε}only shrinks. - Cslib.MachineLearning.PACLearning.IsPACLearnerFor.toIsRPACLearnerForEvery deterministic PAC learner is in particular a randomized PAC learner (with the trivial one-point randomness space
PUnit). - Cslib.MachineLearning.PACLearning.error_map_eq_hypothesisErrorUnder a realizable distribution
P.map (x ↦ (x, c(x))), the general 0-1errorcoincides with the binaryhypothesisError P h c, where… - Cslib.MachineLearning.PACLearning.IsPACLearnerFor.antitone_CThe deterministic PAC learner predicate is antitone in the concept class: a learner for a larger class
C'is also a learner for any…
- Cslib.MachineLearning.PACLearning.IsPACLearnerFor
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in open MeasureTheory Set in open scoped ENNReal NNReal in variable {α : Type*} {β : Type*} [MeasurableSpace α] [MeasurableSpace β] in /-- The *prediction error* (0-1 loss) of a hypothesis `h` under a joint distribution `D` on `α × β`, defined as the probability that the prediction disagrees with the label: `D({(x, y) | h(x) ≠ y})`. -/ noncomputable def Cslib.MachineLearning.PACLearning.error (D : Measure (α × β)) (h : α → β) : ℝ≥0∞ := D {p : α × β | h p.1 ≠ p.2}