Skip to content

Commit c89d06c

Browse files
adridaclaude
andcommitted
docs: neutral wording for the held-out parity bound (comments/docstrings)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fdc701a commit c89d06c

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎docs/troubleshooting.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ set) reports a lower `coverage_cal` than the previous run at the same
4848
**Why.** This is expected, not a regression. TRACER holds parity fixed and lets
4949
coverage float. When new traffic is harder, more diverse, noisier, or introduces
5050
labels the surrogate has not seen, the only way to keep matching the teacher at
51-
your target is to defer more inputs. Coverage falls so that parity stays honest.
51+
your target is to defer more inputs. Coverage falls so that the parity bound still holds.
5252

5353
**Fix.** Usually nothing: a lower coverage at the same parity is the system
5454
adapting correctly. To understand the change:

‎src/tracer/fit/pipeline.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _noop_log(_msg: str) -> None:
2929
def _cp_lower(k: int, n: int, alpha: float) -> float:
3030
"""Exact (Clopper-Pearson) lower confidence bound on a binomial rate.
3131
32-
Used to gate deployment on an honest bound rather than a point estimate, so
32+
Used to gate deployment on a held-out lower bound rather than a point estimate, so
3333
a small or lucky accepted set cannot 'scrape' the target agreement.
3434
"""
3535
if n == 0 or k == 0:
@@ -141,17 +141,17 @@ def _accept_scores(acceptor, probs):
141141

142142

143143
def _calibrate_threshold(scores, preds, y_teacher, target_ta, alpha=0.1, min_accept=10):
144-
"""Choose the accept threshold honestly, then check it generalises.
144+
"""Choose the accept threshold on a held-out lower bound, then check it generalises.
145145
146146
Earlier iterations sat at two extremes. The original gate selected the
147147
threshold and reported its agreement on the *same* calibration set (in-sample
148148
point estimate), so a threshold could clear target by luck and break the
149149
contract on real traffic. The next version held out 50% for a Clopper-Pearson
150-
verification, which is provably honest but so data-hungry that on a few-hundred
150+
verification, which is provably valid (distribution-free) but so data-hungry that on a few-hundred
151151
calibration rows it certified NOTHING at strict targets (banking77 0% @0.98)
152152
even though the confidence ranking clearly supported partial coverage.
153153
154-
This is the hybrid that keeps honesty while recovering that coverage:
154+
This is the hybrid that keeps the held-out guarantee while recovering that coverage:
155155
156156
1. Select on a 70% slice: among thresholds whose Clopper-Pearson LOWER bound
157157
on accepted agreement clears target, take the highest-coverage one
@@ -165,7 +165,7 @@ def _calibrate_threshold(scores, preds, y_teacher, target_ta, alpha=0.1, min_acc
165165
that survives the held-out check, so coverage is monotonic in target.
166166
167167
On very little data (n < 40) there is nothing to hold out, so it falls back to
168-
a single-set Clopper-Pearson lower-bound gate (still honest, just not held-out)
168+
a single-set Clopper-Pearson lower-bound gate (still a valid lower bound, just not held-out)
169169
and flags it. Validated across seeds and datasets at 0.90-0.98 with zero
170170
held-out contract violations.
171171
"""
@@ -219,7 +219,7 @@ def _calibrate_threshold(scores, preds, y_teacher, target_ta, alpha=0.1, min_acc
219219
if (k_v / n_v) < target_ta: # held-out generalisation check
220220
continue
221221
# Report the CP lower bound on the full accepted set (all calibration rows
222-
# at this threshold) as the honest deployable bound.
222+
# at this threshold) as the deployable lower bound.
223223
acc_all = scores >= t
224224
n_all = int(acc_all.sum())
225225
k_all = int((preds[acc_all] == y_teacher[acc_all]).sum())
@@ -447,7 +447,7 @@ def fit_frontier(X, y_teacher, targets, max_fit_labels=8000, min_coverage=0.05,
447447
448448
`alpha` is the confidence level for the deployment lower bound: a candidate
449449
is only certified if the lower bound on its held-out teacher agreement clears
450-
the target, so reported coverage is honest rather than in-sample-optimistic.
450+
the target, so reported coverage reflects a held-out lower bound rather than an in-sample point estimate.
451451
"""
452452
log = log or _noop_log
453453
log(f"fit_frontier: X={X.shape} targets={sorted(set(float(t) for t in targets))} "

‎src/tracer/scanner.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""tracer scan: the day-one verdict on a traces file.
22
3-
Answers three questions in one pass, honestly:
3+
Answers three questions in one pass:
44
1. How much of this traffic is predictable enough for a near-free model?
55
(certifiable share, measured with exact binomial bounds on HELD-OUT
66
data, never in-sample)
@@ -159,7 +159,7 @@ def scan(
159159
) -> ScanResult:
160160
"""Run the scan. Returns a ScanResult; use format_scan / scan_html to render.
161161
162-
Honesty contract: every certifiable claim is an exact binomial lower
162+
Certification contract: every certifiable claim is an exact binomial lower
163163
bound computed on a held-out 30% slice the clustering never saw.
164164
165165
force: on thin data a cluster may not have enough held-out members for any

0 commit comments

Comments
 (0)