Repository navigation
Conversation
calibrate() picks the season with the best score (adjusted R2 by default) whatever the sign of the slope, so a season with a negative temperature response can win for a record whose metadata says it responds positively. expected_sign (1 or -1) restricts the choice to seasons whose slope has that sign, and leaves the record uncalibrated if none does; calib_psms passes it per record through pid_sign_dict. Default behavior is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TsdL1gpFWoD4LYexEPr6LD
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17.
Linear.calibrate(). A newexpected_signargument (1 or -1) restricts the season search to seasons whose slope has that sign. If no season has it, the PSM is left uncalibrated, as when no season has enough overlapping data.calib_psms(). A newpid_sign_dictargument passes the expected sign per record (for example, from the direction in each record's interpretation metadata) to records with theLinearPSM. Records not in the dictionary, and other PSMs, are unconstrained.The default behavior is unchanged.
Use in Presto. We currently do this after calibration in our own workflow. In Presto2k it changes the season of 74 records and drops 48 that have no season with the expected sign.
Tests. Three new tests use a synthetic record that responds positively to Jan to Jun and more strongly, negatively, to Jul to Dec. Without a constraint, Jul to Dec is chosen. With
expected_sign=1, Jan to Jun is chosen. With no matching season, the PSM isn't calibrated. The full suite passes (220 tests).Not covered.
Bilinearhas no equivalent yet.Note. This and the R floor PR both add an argument to
calib_psms(), so whichever is merged second will need a small conflict resolved.🤖 Generated with Claude Code
https://claude.ai/code/session_01TsdL1gpFWoD4LYexEPr6LD