Margin generalization bounds via Rademacher complexity #
For binary classification with real-valued scoring hypotheses h : α → ℝ and labels y : Bool
read as signs signVal y ∈ {-1, +1}, a labeled example (x, y) has signed margin
signVal y * h x. A nonpositive signed margin (signVal y * h x ≤ 0) counts as a margin error.
For ρ > 0, the ρ-margin loss Φ_ρ(u) = min 1 (max 0 (1 - u / ρ))
[MohriRostamizadehTalwalkar2018, Definition 5.5] interpolates linearly between 1 on (-∞, 0]
and 0 on [ρ, ∞):
Φ_ρ(u) ∈ [0, 1]for allu,𝟙[u ≤ 0] ≤ Φ_ρ(u) ≤ 𝟙[u ≤ ρ], andΦ_ρis(1 / ρ)-Lipschitz.
Combining the [0, 1] Rademacher generalization bounds
(CslibFrontier.MachineLearning.Rademacher.Generalization) for the induced margin-loss class
{(x, y) ↦ Φ_ρ(signVal y * h x) | h ∈ H} with Talagrand's contraction lemma
(CslibFrontier.MachineLearning.Rademacher.Contraction) yields the fixed-margin generalization
bounds of [MohriRostamizadehTalwalkar2018, Theorem 5.8, (5.39) and (5.40)]: on a finite domain α,
with probability at least 1 - δ over m > 0 independent draws from D : PMF (α × Bool), every
hypothesis h in a uniformly bounded class H : Set (α → ℝ) satisfies
Pr_D[signVal y * h x ≤ 0] ≤ R̂_{S, ρ}(h) + (2 / ρ) R_m(H) + √(log (1 / δ) / (2 m)), andPr_D[signVal y * h x ≤ 0] ≤ R̂_{S, ρ}(h) + (2 / ρ) R̂_{S_X}(H) + 3 √(log (2 / δ) / (2 m)),
where R_m(H) is taken under the input marginal D.map Prod.fst and S_X is the unlabeled
sample fun i => (S i).1. Uniform boundedness of H supplies the BddAbove hypothesis required by
the real conditional supremum ⨆ in rademacherAverage.
Main definitions #
Cslib.MachineLearning.marginLoss: theρ-margin lossΦ_ρ(u) = min 1 (max 0 (1 - u / ρ)).Cslib.MachineLearning.empiricalMarginLoss: the empiricalρ-margin lossR̂_{S, ρ}(h).Cslib.MachineLearning.marginRisk: the populationρ-margin loss underD : PMF (α × Bool).Cslib.MachineLearning.marginLossClass: the composed class{(x, y) ↦ Φ_ρ(signVal y * h x) | h ∈ H}.
Main results #
Cslib.MachineLearning.marginLoss_mem_Icc,Cslib.MachineLearning.boole_le_marginLoss,Cslib.MachineLearning.marginLoss_le_boole,Cslib.MachineLearning.lipschitzWith_marginLoss,Cslib.MachineLearning.lipschitzWith_marginLoss_nnreal:[0, 1]range, indicator sandwich, and1 / ρ-Lipschitz continuity ofmarginLoss ρ.Cslib.MachineLearning.empiricalRademacherComplexity_marginLossClass_le,Cslib.MachineLearning.rademacherComplexity_marginLossClass_le: contraction of theρ-margin loss class by1 / ρ.Cslib.MachineLearning.rademacherComplexity_margin_bound,Cslib.MachineLearning.empiricalRademacherComplexity_margin_bound: fixed-ρmargin bounds (5.39) and (5.40) [MohriRostamizadehTalwalkar2018, Theorem 5.8].Cslib.MachineLearning.margin_bound_of_finset: finite-class margin corollary via Massart's lemma.
References #
- M. Mohri, A. Rostamizadeh, A. Talwalkar, Foundations of Machine Learning, 2nd ed., Section 5.4, Definitions 5.5–5.6 and Theorem 5.8
- P. L. Bartlett, S. Mendelson, Rademacher and Gaussian complexities: risk bounds and structural results, Section 3, Theorem 7
The ρ-margin loss #
The ρ-margin loss Φ_ρ(u) = min 1 (max 0 (1 - u / ρ))
[MohriRostamizadehTalwalkar2018, Definition 5.5].
The ρ-margin loss is nonnegative.
The ρ-margin loss is at most 1.
The ρ-margin loss takes values in [0, 1].
On nonpositive margins u ≤ 0 (ρ > 0), the ρ-margin loss equals 1.
Beyond margin ρ (ρ ≤ u, ρ > 0), the ρ-margin loss vanishes.
On [0, ρ] (ρ > 0), the ρ-margin loss is the linear ramp 1 - u / ρ.
For ρ ≥ 0, marginLoss ρ is (1 / ρ)-Lipschitz
[MohriRostamizadehTalwalkar2018, Section 5.4].
NNReal-parameterized form of lipschitzWith_marginLoss:
LipschitzWith (1 / ρ) (marginLoss ρ).
Empirical and population margin losses #
The empirical ρ-margin loss
R̂_{S, ρ}(h) = (1 / m) ∑ i, Φ_ρ (signVal (S i).2 * h (S i).1) of a real-valued hypothesis
h : α → ℝ on a labeled sample S : Fin m → α × Bool
[MohriRostamizadehTalwalkar2018, Definition 5.6].
The ρ-margin loss class and contraction #
Contraction of marginLossClass (empirical) [MohriRostamizadehTalwalkar2018, proof of
Theorem 5.8]: for ρ ≥ 0 and a uniformly bounded class H : Set (α → ℝ), the empirical Rademacher
complexity of marginLossClass ρ H on S is at most (1 / ρ) times that of H on the unlabeled
points fun i => (S i).1.
Contraction of marginLossClass (population) [MohriRostamizadehTalwalkar2018, proof of
Theorem 5.8]: for ρ ≥ 0 and a uniformly bounded class H : Set (α → ℝ) on a finite domain α,
the Rademacher complexity of marginLossClass ρ H under D is at most (1 / ρ) times that of H
under D.map Prod.fst.
Margin generalization bounds #
Population ρ-margin risk generalization bound via R_m(H).
Data-dependent population ρ-margin risk generalization bound via R̂_{S_X}(H).
Margin generalization bound [MohriRostamizadehTalwalkar2018, Theorem 5.8, (5.39)]: for a
uniformly bounded class H : Set (α → ℝ) on a finite domain α, margin ρ > 0, and m > 0
independent draws from D : PMF (α × Bool), with probability at least 1 - δ every h ∈ H
satisfies
Pr_D[signVal y * h x ≤ 0] ≤ R̂_{S, ρ}(h) + (2 / ρ) R_m(H) + √(log (1 / δ) / (2 m)),
where R_m(H) is taken under the marginal D.map Prod.fst.
Data-dependent margin generalization bound [MohriRostamizadehTalwalkar2018, Theorem 5.8,
(5.40)]: for a uniformly bounded class H : Set (α → ℝ) on a finite domain α, margin ρ > 0,
and m > 0 independent draws from D : PMF (α × Bool), with probability at least 1 - δ every
h ∈ H satisfies
Pr_D[signVal y * h x ≤ 0] ≤ R̂_{S, ρ}(h) + (2 / ρ) R̂_{S_X}(H) + 3 √(log (2 / δ) / (2 m)),
where S_X is the sequence of unlabeled inputs fun i => (S i).1.
Finite-class margin bound through Massart's lemma [MohriRostamizadehTalwalkar2018,
Theorems 3.7 and 5.8]: for a finite class H : Finset (α → ℝ) with values in [-B, B] (B ≥ 0),
margin ρ > 0, and m > 0 independent draws from D, with probability at least 1 - δ every
h ∈ H satisfies
Pr_D[signVal y * h x ≤ 0] ≤ R̂_{S, ρ}(h) + (2 B / ρ) √(2 log |H| / m) + √(log (1 / δ) / (2 m)).