AFTD Auto-Formalizing Theoretical Domains

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.
Verified
08 Oct 2026
Axioms
none listed
Used by 14

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}
See it in the graphDiscuss this resultChallenge it