Skip to content

Lead the EPE and EPL definitions with the fitted model - #641

Merged
d-morrison merged 3 commits into
mainfrom
claude/epe-lead-with-model
Nov 20, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/epe-lead-with-model

Conversation

@d-morrison

@d-morrison d-morrison commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

Why

Ezra asked whether #def-epe should emphasize models over fitting procedures. Both #def-epe and #def-epl opened with "of a fitting procedure F at training-set size n", which made the procedure the subject; the fitted model only appeared at the end. psw's rule Make the fitted model the subject, not the fitting procedure says to name the procedure only when describing how a fitted model is built, or for an expectation over the training sets the procedure is applied to.

What changed

Wording, in _subfiles/model-validation/:

  • _def-epe.qmd: the definition now opens with the fitted model f̂ = f̂(T). A second sentence says the model comes from a fitting procedure F applied to a random training set of n observations, drawn independently of the new observation (X*, Y*). That is why the expected value, taken over T and Y*, depends on F and n. The clause "is its expected prediction loss under squared-error loss" is dropped, because #rem-epe-mse already states that equality as a result. Dropping it also dropped the independence assumption #def-epe used to inherit from #def-epl, so the definition now states that assumption itself (raised in the cross-model review).
  • _def-epl.qmd: the same restructuring. "a new outcome" becomes a linked "new observation (X*, Y*)".
  • New first-use links that check-term-links asked for on the changed lines: expected value, new observation, and observations.

Mechanical, content-identical split, which check-one-div-per-subfile requires for any subfile this PR adds lines to:

  • #rem-epe-mse moves from _def-epe.qmd to _rem-epe-mse.qmd.
  • #rem-source-epe moves from _def-epe.qmd to _rem-source-epe.qmd.
  • #rem-epl-generalization-error moves from _def-epl.qmd to _rem-epl-generalization-error.qmd.
  • model-validation.qmd includes each remark right after its definition, on the same slide as before, so the rendered page keeps the same order.

The display equations, ids and notation (\epe{\fitproc}{\nobs}{\predvar}) are unchanged.

Checks

  • quarto render model-validation.qmd --to html exits 0. I read the rendered text of both definitions, and the math renders. Before and after the split, the rendered HTML differs only in the two reworded definitions, the page's source listing, the last-modified date and the order of the CSS rules.
  • I ran gha v3 check-term-links (with the mds and pds term lists, as CI does), check-one-div-per-subfile, check-definite-antecedents and check-avoided-words on the diff against origin/main. All four are clean at the head.

🤖 Generated with Claude Code

https://claude.ai/code/session_019xfc9o6YjMnHWPLc9f5oyb

Both definitions opened with "of a fitting procedure F at training-set
size n", so the procedure was the subject and the fitted model appeared
only at the end. psw's "Make the fitted model the subject, not the
fitting procedure" names the procedure only for how a fitted model is
built or for an expectation over training sets. Each definition now
opens with the fitted model, then says that the model comes from a
procedure applied to a random training set, which is why the expected
value depends on F and n. The display equations and notation are
unchanged.

The EPE definition no longer restates that it is the expected
prediction loss under squared-error loss; rem-epe-mse already states
that equality as a result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9o6YjMnHWPLc9f5oyb
@d-morrison d-morrison self-assigned this Nov 19, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

check-one-div-per-subfile fails a PR that adds lines to a subfile with
more than one top-level div. _def-epe.qmd also held rem-epe-mse and
rem-source-epe, and _def-epl.qmd held rem-epl-generalization-error.
Each remark moves unchanged to its own _rem-<stem>.qmd, included right
after its definition, so the page renders the same.

check-term-links reads "averages" as a defined term from the mds and
pds term lists, so "the expected value averages over" becomes "is
taken over".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9o6YjMnHWPLc9f5oyb
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@d-morrison

Copy link
Copy Markdown
Contributor Author

Cross-model review (agy, gemini-4-hydrogen-high) of head 1d7e9c4:

Summary

PR Morrison-Lab/sds#641 restructures #def-epe (_subfiles/model-validation/_def-epe.qmd) and #def-epl (_subfiles/model-validation/_def-epl.qmd) to open with the fitted model $\fitted = \fitmodf{\trainset}$ rather than the fitting procedure $\fitproc$ at training-set size $\nobs$, adds first-use term links (expected value, new observation, observations), and mechanically splits #rem-epl-generalization-error, #rem-epe-mse, and #rem-source-epe into their own _subfiles/model-validation/_rem-*.qmd files included in the same order in model-validation.qmd.

The mechanical subfile splits and model-validation.qmd includes are content-identical and preserve order and slide breaks, and the display equations and labels (#eq-epe, #eq-epl) are unchanged. However, dropping the definitional link from #def-epe to #def-epl leaves #def-epe without the independence condition between $\trainset$ and $(\newpredvar, \newoutvar)$.

Findings

  1. Missing independence condition in #def-epe (_subfiles/model-validation/_def-epe.qmd):
    Previously, #def-epe defined EPE as #def-epl's "expected prediction loss under squared-error loss", so it inherited #def-epl's assumption that the training set $\trainset$ is drawn independently of $(\newpredvar, \newoutvar)$. This PR drops that reference to #def-epl to make #def-epe standalone, while _def-epl.qmd retains drawn independently of $(\newpredvar, \newoutvar)$ even after linking [new observation](#def-new-observation). Without that clause in _def-epe.qmd (unless #def-new-observation itself guarantees independence from $\trainset$, which cannot be verified from the diff alone and would still leave #def-epe inconsistent with #def-epl), the joint distribution over $\trainset$ and $\newoutvar$ in The expected value is taken over \trainset and over \newoutvar is under-specified, and #rem-epe-mse's equality $\epl{\fitproc}{\nobs}{\predvar} = \epe{\fitproc}{\nobs}{\predvar}$ under squared-error loss relies on that independence.

Verdict / Reviewed-Commit

VERDICT: NOT CLEAN

Reviewed-Commit: 1d7e9c4

Posted by Claude Code (AI agent) --- not written by a human.

The cross-model review on this PR noted that def-epe, once it no longer
reads as def-epl under squared-error loss, lost def-epl's condition that
the training set is drawn independently of the new observation. Add the
same clause def-epl carries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9o6YjMnHWPLc9f5oyb

Copy link
Copy Markdown
Contributor Author

Fixed in ae34b55. #def-epe now says the training set is "drawn independently of $(\newpredvar, \newoutvar)$", the same clause #def-epl carries. The PR body now explains this.


Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Commit ae34b55 adds one line to _subfiles/model-validation/_def-epe.qmd. It says the training set is "drawn independently of $(\newpredvar, \newoutvar)$". I read the full definition and found nothing to flag.

  • Statistics: the clause is correct. The expectation is taken over $\trainset$ and $\newoutvar$ with $\newpredvar = \predvar$ held fixed. A training set independent of the new observation is the standard assumption behind EPE, and it makes the stated conditioning well defined.
  • Macros: \newpredvar and \newoutvar were already used in the same div, and no new math symbols are introduced.
  • Line breaks: the clause sits on its own line, and no line holds two clauses.
  • Forward references: none added. $(\newpredvar, \newoutvar)$ has an antecedent earlier in the same sentence.
  • Div structure: the div is still one definition with one term (EPE, with ESPE as an alias), and its #eq-epe equation is unchanged.

The prior review of the earlier head, posted 2026-11-19T23:55:46Z on 1d7e9c4, was Ready for merge. I did not re-render the page, but the new line does not touch anything that review checked, so that verdict still stands.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "ae34b554a117d3847f6b8b7a08081a62c9abf8d6",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked the one-line addition to _subfiles/model-validation/_def-epe.qmd: the independence clause is statistically correct, uses existing macros, sits on its own line, and adds no forward references.",
  "holistic_assessment": "The change is a scoped one-line clarification inside one definition div, keeps ids and the equation unchanged, and leaves the prior clean review of the earlier head valid."
}

Reviewed commit: ae34b55

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.1842 (review) — run

@d-morrison

Copy link
Copy Markdown
Contributor Author

Cross-model review (agy, gemini-4-hydrogen-high) of head ae34b55:

Summary

This PR restructures #def-epe (_subfiles/model-validation/_def-epe.qmd) and #def-epl (_subfiles/model-validation/_def-epl.qmd) to lead with the fitted model $\hat{f} = \hat{f}(T)$ rather than the fitting procedure, adds the missing first-use term links (expected value, new observation, observations), and restores the training-set independence assumption (drawn independently of (X*, Y*)) directly in #def-epe after removing its reference to #def-epl. It also mechanically splits the three remark blocks (#rem-epe-mse, #rem-source-epe, and #rem-epl-generalization-error) into their own subfiles and includes them in model-validation.qmd in the same slide positions.

Findings

None.

Verdict

VERDICT: CLEAN

Reviewed-Commit: ae34b55

Posted by Claude Code (AI agent) --- not written by a human.

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/sds/pr-preview/pr-641/

Built to branch gh-pages at 2026-11-20 00:36 UTC.

@d-morrison

Copy link
Copy Markdown
Contributor Author

Annotation dispositions for head ae34b55:

Check runs 135986448143,135986336261,135986335583:

  • SUBMODULES_TOKEN is empty (notices, 2): the submodules are public, so the anonymous clone worked.
  • Skipping element-level diff highlighting (notices, 2): the preview diff hit its 500-element cap. This is informational, and the rendered pages are unaffected.

Posted by Claude Code (AI agent) --- not written by a human.

@d-morrison
d-morrison merged commit 1f86a9d into main Nov 20, 2026
55 checks passed
@d-morrison
d-morrison deleted the claude/epe-lead-with-model branch November 20, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants