Repository navigation
Solve parts (b) and (c) of the Wage polynomial exercise; scale age in the Python CV - #1399
d-morrison wants to merge 3 commits into
Conversation
… in the Python CV The exercise asks for a confidence band (b) and a cross-validated step function (c), but the solution only did (a). The Python solution also fed raw age**10 to least squares, which is ill-conditioned; it now standardizes age first, as the R solution's poly() does. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nh61VJUp2V6tGvtkZ3BZKF
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nh61VJUp2V6tGvtkZ3BZKF
|
Generated by Claude Code |
|
The re-run of Generated by Claude Code |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nh61VJUp2V6tGvtkZ3BZKF
|
Claude finished review — View run This confirms the only change since the last review round is exactly the fix the author claimed: I re-checked this fix against the rule it was flagged under: I also double-checked that no other part of the diff changed in this round — the full PR diff ( VerdictReady for merge — the prior round's sole blocking finding ( Structured Review Data (JSON){
"schema_version": "1.1",
"reviewer": "claude",
"commit_sha": "73795ae619e2be5dd558c85f8479c12d63f54b94",
"verdict": "CLEAN",
"findings": [],
"detailed_assessment": "The only change since the last round, in _subfiles/generalized-additive-models/_exr-gams-applied.qmd, renames Wage_cut to wage_cut, resolving the previously confirmed lintr object-name violation with no new defect introduced.",
"holistic_assessment": "The fix satisfies the prior blocking requirement exactly as scoped, integrates cleanly with the already-verified CV and prediction logic, and carries no regression risk since no other lines changed in this round."
}Reviewed commit: 10adecd |
Built to branch |
Before:
exr-wage-polynomial-cvasks for a confidence band (b) and a cross-validated step function (c), but its solution only did (a). The Python solution passed rawage**10to least squares, which is ill-conditioned, and its folds were not shuffled.After: the R and Python solutions both do (a), (b) and (c). Python standardizes
agebefore taking powers, as the R solution'spoly()does, and uses shuffled folds. R and Python pick the same answers: degree 9 and 7 cut-points.How: only
_subfiles/generalized-additive-models/_exr-gams-applied.qmdchanges. I renderedchapters/generalized-additive-models.qmdto HTML with no warnings; the R output reads "CV-selected degree: 9" and "CV-selected number of cut-points: 7". The Python chunk is not run in the rme render (eval: false), so I ran it locally against the sameWagedata and got the same two values.typosis clean on the file. Part of the drift audit in Morrison-Lab/lds#1214, which listed these as follow-ups to rme#1393.Differences from the source (ISLRv2 Applied 6):
PolynomialFeatureson raw ageKcut-points makeK + 1intervals, stated in the textGenerated by Claude Code