The weighted majority algorithm #
In prediction from expert advice [LW94], [AroraHazanKale2012, §1.1], each
round t the experts ι give binary advice advice t i, the learner predicts a bit, and then the
outcome outcome t is revealed. The weighted majority algorithm with parameter η keeps a
weight for each expert, starting at 1 and multiplied by 1 - η whenever the expert errs
[AroraHazanKale2012, (1.1)]. It predicts the bit advised by the larger total weight. These are the
multiplicative weights for the losses expertLoss, 1 for a wrong expert and 0 otherwise, so
the weight of expert i in round t is (1 - η) ^ mᵢ(t), where mᵢ(t) counts its mistakes
(weight_mwFactor_expertLoss).
For 0 < η ≤ 1 / 2, the number of mistakes M(T) of weighted majority, with ties broken
arbitrarily, satisfies M(T) ≤ 2 (1 + η) mᵢ(T) + 2 ln n / η for every expert i (wm_mistakes_le,
[AroraHazanKale2012, Theorem 1.1]). Tie-breaking is a hypothesis on the predictions (the advice they
reject never outweighs the advice they follow), so the theorem covers every tie-breaking rule. The
rule weightedMajority, which breaks ties towards true, satisfies it
(weightedMajority_mistakes_le).
The proof is that of [AHK12]: in a round with a mistake, the experts that agreed with
the prediction were wrong and carry at least half of the weight, so the learner's expected loss is
at least 1 / 2 and the potential shrinks by the factor 1 - η / 2. It is phrased through the
potential inequality sum_log_le_log_card_add, with -ln (1 - η) ≤ η + η ^ 2
(Real.neg_sub_sq_le_log_one_sub).
Main definitions #
Cslib.MachineLearning.OnlineLearning.Experts.expertLoss: the mistake indicator of an expert.Cslib.MachineLearning.OnlineLearning.Experts.weightedMajority: the weighted majority prediction.
Main results #
Cslib.MachineLearning.OnlineLearning.Experts.weight_mwFactor_expertLoss: the weights are(1 - η) ^ mᵢ(t).Cslib.MachineLearning.OnlineLearning.Experts.wm_mistakes_le: [AroraHazanKale2012, Theorem 1.1], for any tie-breaking.Cslib.MachineLearning.OnlineLearning.Experts.weightedMajority_mistakes_le: the same bound forweightedMajority.
References #
The weight of expert i in round t is (1 - η) ^ mᵢ(t), where mᵢ(t) is the number of its
mistakes before round t [AroraHazanKale2012, (1.1)].
The weighted majority algorithm [AroraHazanKale2012, Theorem 1.1]: let 0 < η ≤ 1 / 2,
and let pred be weighted majority predictions with arbitrary tie-breaking, that is, in each round
t < T the weight of the experts advising against pred t is at most that of the experts advising
pred t. Then for every expert i, the number of mistakes is
M(T) ≤ 2 (1 + η) mᵢ(T) + 2 ln n / η.
weightedMajority follows the advice of the larger total weight.
The weighted majority algorithm [AroraHazanKale2012, Theorem 1.1], for the rule
weightedMajority: for 0 < η ≤ 1 / 2 and every expert i,
M(T) ≤ 2 (1 + η) mᵢ(T) + 2 ln n / η.