Documentation

CslibFrontier.MachineLearning.OnlineLearning.MistakeBound.Littlestone

Mistake trees and the Littlestone dimension #

A complete k-mistake tree for a concept class C [Littlestone1988, §3, Definition 2] is a complete binary tree of height k. Its root is C, each internal node C' is labelled with an instance x, the two children of C' are the subclasses of C' with c x = false and with c x = true, and every node is nonempty. HasMistakeTree d C states that such a tree of height d exists. It is defined by recursion on d, so it needs no tree data type: a tree of height d + 1 is a root instance x such that both restrictions versionSpace C [(x, y)] have trees of height d. hasMistakeTree_iff_exists_tree relates it to the explicit form of [ShalevShwartzBenDavid2014, §21.1]: an instance tree, given as a map from the paths List Bool to the instances, whose root-to-leaf paths of length d are all realizable by C.

The Littlestone dimension littlestoneDim C : ℕ∞ is the supremum of the heights of the complete mistake trees for C. Littlestone writes it K(C) and sets K(∅) = -1; here littlestoneDim ∅ = 0, and a class with complete mistake trees of every height has dimension ⊤.

Lower bound [Littlestone1988, §3, Lemma 1]. An adversary walking down a complete d-mistake tree forces every deterministic learner to err d times: at each node it presents the label of the node and then reveals the opposite of the learner's prediction (exists_realizable_mistakes_eq). Hence littlestoneDim C ≤ mistakeBound A C for every learner A (littlestoneDim_le_mistakeBound), and littlestoneDim C ≤ optimalMistakeBound C. The matching upper bound, attained by the standard optimal algorithm, is in CslibFrontier.MachineLearning.OnlineLearning.MistakeBound.SOA.

Main definitions #

Main results #

References #

HasMistakeTree d C: the class C has a complete mistake tree of height d [Littlestone1988, §3, Definition 2]. A tree of height 0 is a nonempty root; a tree of height d + 1 labels the root with an instance x and has, for both labels y, a tree of height d for the concepts of C with c x = y.

Equations
Instances For

    Pruning a complete mistake tree gives complete mistake trees of every smaller height.

    The explicit form #

    The labelled path through the instance tree T : List Bool → α along the labels ys: the node reached by the labels zs is labelled with the instance T zs.

    Equations
    Instances For
      @[simp]
      theorem Cslib.MachineLearning.OnlineLearning.MistakeBound.treePath_cons {α : Type u_1} (T : List Bool → α) (y : Bool) (ys : List Bool) :
      treePath T (y :: ys) = (T [], y) :: treePath (fun (zs : List Bool) => T (y :: zs)) ys

      The explicit form of mistake trees [ShalevShwartzBenDavid2014, §21.1]: C has a complete mistake tree of height d iff some instance tree has all its labelled root-to-leaf paths of length d realizable by C. The instance space must be nonempty to label the leaves when d = 0.

      The Littlestone dimension #

      The Littlestone dimension K(C) [Littlestone1988, §3]: the supremum of the heights of the complete mistake trees for C, in ℕ∞. It is 0 for the empty class, where Littlestone sets K(∅) = -1.

      Equations
      Instances For

        For a nonempty class, d ≤ littlestoneDim C iff C has a complete mistake tree of height d.

        If both restrictions of C at x are nonempty, the Littlestone dimension of C exceeds the smaller of their dimensions: complete trees for both combine under a root labelled x.

        The lower bound #

        From a complete d-mistake tree, an adversary forces any learner, after any history, to err on each of d rounds of a sequence realizable by C [Littlestone1988, §3, proof of Lemma 1].

        A complete d-mistake tree for C forces every deterministic learner to err on all d rounds of some sequence of length d realizable by C.

        Littlestone's lower bound [Littlestone1988, §3, Lemma 1]: every deterministic learner makes at least littlestoneDim C mistakes in the worst case.