Documentation

CslibFrontier.MachineLearning.PACLearning.AgnosticVC

Agnostic PAC learning of classes of finite VC dimension #

A binary concept class C of finite VC dimension on a countable domain is agnostically PAC learnable for the 0-1 loss by empirical risk minimization [VapnikChervonenkis1971; ShalevShwartzBenDavid2014, Theorem 6.7]. If every finite set shattered by C has at most d points, then under every distribution D on labeled examples an ERM learner on

m ≥ (64 / ε²) (2 d log (20 / ε) + log (4 / δ))

i.i.d. examples outputs a hypothesis with error at most optimalError D C + ε with probability at least 1 - δ. This is the upstream IsPACLearnerFor over the family Set.univ of all distributions. The proof combines uniform convergence from the growth function (VCUniformConvergence.lean) with ERM on an ε / 2-representative sample [ShalevShwartzBenDavid2014, Lemma 4.2].

The sample size is O ((d log (1 / ε) + log (1 / δ)) / ε²). The sharp agnostic rate O ((d + log (1 / δ)) / ε²) [ShalevShwartzBenDavid2014, Theorem 6.8] needs chaining and is not proved here. The domain is countable with measurable singletons, so that every set of samples is measurable; uncountable domains need a measurability hypothesis on the class. The learners are semantic maps: no running time is claimed, and finding an empirical risk minimizer can be computationally hard.

Main results #

References #

Agnostic tail bound for ERM on a countable domain: under every distribution D, an empirical risk minimizer for C misses optimalError D C + ε with probability at most 4 Π_C(2m) exp (-m ε² / 32).

theorem Cslib.MachineLearning.PACLearning.IsERM.measure_pi_lt_error_le_of_uniformConvergenceSampleSize_le {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] [Countable α] (D : MeasureTheory.Measure (α × Bool)) [MeasureTheory.IsProbabilityMeasure D] {C : ConceptClass α Bool} {d : ℕ} (hC : ∀ (W : Finset α), SetShatters C ↑W → W.card ≤ d) {m : ℕ} {A : Learner α Bool m} (hA : IsERM A C) {ε δ : ℝ} (hε : 0 < ε) (hε20 : ε ≤ 20) (hδ : 0 < δ) (hm : uniformConvergenceSampleSize d (ε / 2) δ ≤ ↑m) :
(MeasureTheory.Measure.pi fun (x : Fin m) => D) {S : Fin m → α × Bool | optimalError D C + ENNReal.ofReal ε < error D (A S)} ≤ ENNReal.ofReal δ

Agnostic learning of a class of finite VC dimension by ERM on a countable domain: if every finite set shattered by C has at most d points and m ≥ (64 / ε²) (2 d log (20 / ε) + log (4 / δ)), then under every distribution an empirical risk minimizer for C misses optimalError D C + ε with probability at most δ.

theorem Cslib.MachineLearning.PACLearning.isPACLearnerFor_univ_of_uniformConvergenceSampleSize_le {α : Type u_1} [MeasurableSpace α] [MeasurableSingletonClass α] [Countable α] {C : ConceptClass α Bool} {d : ℕ} (hC : ∀ (W : Finset α), SetShatters C ↑W → W.card ≤ d) {m : ℕ} {ε δ : ↑(Set.Ioo 0 1)} (hm : uniformConvergenceSampleSize d (↑↑ε / 2) ↑↑δ ≤ ↑m) :

Agnostic PAC learning of classes of finite VC dimension for the 0-1 loss on a countable domain: a class whose shattered finite sets have at most d points is (ε, δ)-PAC learnable over all distributions from m ≥ (64 / ε²) (2 d log (20 / ε) + log (4 / δ)) examples. If C is nonempty the learner is any empirical risk minimizer. If C is empty the optimal error is ⊤ and any learner works.

The agnostic sample complexity of a class of finite VC dimension on a countable domain is at most ⌈(64 / ε²) (2 vcDim C log (20 / ε) + log (4 / δ))⌉.

Finite VC dimension implies agnostic PAC learnability on a countable domain [VapnikChervonenkis1971; ShalevShwartzBenDavid2014, Theorem 6.7].

Finite VC dimension implies the uniform convergence property over all distributions on a countable domain [ShalevShwartzBenDavid2014, Theorem 6.7, 6 ⇒ 1]: the threshold at accuracy ε and confidence δ is ⌈(16 / ε²) (2 vcDim C log (10 / ε) + log (4 / δ))⌉.