Pick how many rules the learner can choose from, how accurate it must be, and how much risk you accept. The formula returns the number of labeled examples
Running example: a spam filter. A rule is one way to decide spam or not spam, and an example is one labeled email. Assumes the realizable case, where at least one rule in your list is perfect. Formula from Understanding Machine Learning by Shalev-Shwartz and Ben-David, chapter 2
m ≥ln( |H| / δ )ε
Sample complexity bound for a finite hypothesis class (realizable PAC case)
100
emails needed
×1.00 vs baseline
The knobs
1 rule1 billion rules
0.1% (very strict)50% (very loose)
0.01% (very sure)50% (coin flip)
1010,000
Notation key
Each symbol on this page, with its standard English technical name
m
Sample size (training set size)
The number of labeled training examples the learner sees
|H|
Cardinality of the hypothesis class
How many rules the learner is allowed to choose from
h
Hypothesis (predictor)
One rule, for example one way to decide spam or not spam
ε
Accuracy parameter (epsilon)
The most error you accept on new, unseen data (the true error bound)
δ
Confidence parameter (delta)
The chance that the training sample misleads the learner. Confidence is 1 − δ
ln
Natural logarithm
Logarithm with base e. It grows slowly, which is why |H| and δ are cheap
⌈x⌉
Ceiling function (round up)
m must be a whole number, so the result is rounded up
h*
Realizability assumption
At least one rule in the list makes no mistakes on the true distribution
PAC
Probably Approximately Correct guarantee
With probability at least 1 − δ, the chosen rule has true error at most ε
Which knob moves the answer
Each chart changes one knob and keeps the other two where you set them. All three share one vertical scale, so the steep one is the expensive one. The dot is where you are now
|H| rules
ε accuracy
δ risk
Make one knob 10 times harder
From your current settings, change one knob at a time: 10 times more rules, 10 times smaller δ, or 10 times smaller ε