count-exact-rows-before-you-fit-a-correction

Solid

Use at implementation and experimentation when the target may be a deterministic function of the inputs - a computed score, a derived column, a simulator or rule-based output - your reconstruction of it is close but not equal, and the next thing you planned was to train a model on the difference. Covers the fraction-reproduced-exactly measure that mean error hides, how to choose its tolerance from the residuals instead of by taste, how to read a residual that takes only a few distinct values, and the gate a learned correction must clear before it goes on top of an analytic base.

AI & Automation 805 stars 25 forks Updated 2 weeks ago NOASSERTION

Install

View on GitHub

Quality Score: 82/100

Stars 20%
97
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Count the rows you get exactly right, then decide what to do about the rest Two runs report a mean absolute error near 1e-3 on the same 5,000-row split. - **Run A** reproduces 4,987 rows to better than 1e-6 and misses 13, by about 0.1 to 0.4 each. Its remaining work is thirteen rows long and each one has a nameable cause. - **Run B** reproduces none of them, is off by ~1e-4 in the middle of the distribution and ~1e-2 in the tail, and its remaining work is a five-thousand-row approximation problem. Those are opposite situations demanding opposite next actions, and the metric being scored cannot tell them apart — A scored 0.00069, B scored 0.00153, a factor of two on a task where the gap in *understanding* is total. Both are real: they are two arms on one task, and B lost. One number separates them, and it is not the mean. ## Make the exact fraction the progress metric **Set the tolerance from the residuals, not from taste.** Sweep it by decades and look for a plateau — a stretch where the count does not move is the gap between "right" and "wrong", and anywhere inside it is the right tolerance: ```python a = np.abs(resid) print(f"MAE {a.mean():.3e} median {np.median(a):.3e} max {a.max():.3e}") for e in range(-9, 1): # count under each decade print(f" |r| < 1e{e}: {(a < 10.0**e).sum()}") for e in range(-9, 1): # and how many live in each decade print(f" 1e{e}..1e{e+1}: {np.sum((a >= 10.0**e) & (a < 10.0**(e+...

Details

Author
tangxiangru
Repository
tangxiangru/AutoR
Created
6 months ago
Last Updated
2 weeks ago
Language
Python
License
NOASSERTION

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

chemistry-reproduce-the-scoring-path-before-you-replace-it

Use at implementation, experimentation and analysis when you are reproducing a published benchmark number and the source's scoring path is one you can read — which rows are scored, in what order, how many the loader drops, which epoch is reported, how tasks are pooled, over how many seeds. Covers implementing that path exactly before improving it, the one-row-per-step ladder from the published rule down to your own honest estimate, and why one un-replicated step makes the reproduction gap you report uninterpretable.

805 Updated 2 weeks ago
tangxiangru
AI & Automation Solid

a-cut-point-is-a-fitted-parameter-not-a-setting

Use whenever a column of your submission is decided by comparing a continuous score against a number you chose -- whether to commit an answer or declare the row unanswerable, whether to flag a borderline case, which output to emit when the model is unsure. Covers the two questions that number silently answers, why it gets fitted on the smallest labelled sample in the run and then applied to the largest split, the statistic it should have been swept on, and the commit-rate print-out that tells you it is on the wrong side of the tail.

805 Updated 2 weeks ago
tangxiangru
Code & Development Solid

rseng-numerical-accuracy

Covers floating-point correctness in research code: why 0.1 + 0.2 != 0.3, choosing absolute vs relative tolerances in tests, accumulation error and safe summation, precision choices (float32 vs float64), catastrophic cancellation, NaN and infinity handling, and cross-platform or cross-library result drift. Use PROACTIVELY when floating-point comparisons fail mysteriously, when writing numerical tests or choosing tolerances, when results differ across machines, compilers, BLAS builds or library versions, or when precision or numerical stability questions arise in analysis or simulation code.

14 Updated 4 days ago
fdiblen