Repository navigation
Apply regression target transforms to the unnormalized target [RES-2639] - #1199
Merged
Merged
Conversation
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
from
August 21, 2026 14:42
553c0ec to
e7d29d7
Compare
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
from
September 23, 2026 12:41
e7d29d7 to
b38d26e
Compare
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
from
September 23, 2026 12:57
b38d26e to
9d28c4d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9d28c4d. Configure here.
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
from
September 24, 2026 07:46
9d28c4d to
2b3d4bb
Compare
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
2 times, most recently
from
September 24, 2026 10:23
92fab0d to
f1bdf93
Compare
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
2 times, most recently
from
October 13, 2026 10:31
8e59d43 to
57d49a8
Compare
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
from
October 23, 2026 12:45
57d49a8 to
a9560fe
Compare
LeoGrin
previously approved these changes
Oct 26, 2026
Collaborator
There was a problem hiding this comment.
Thanks, and sorry for the super late review!
LGTM, a few comments:
logor1_plus_log: now on invalid ys (<=0 or <= -1),fitworks, butpredictcrashes with a weird error:ValueError: zero-size array to reduction operation maximum which has no identity. Should we add some validation and crash nicely?power: IIUC now we still standardizeybeforesafepowerbut notpower, which is weird? Could also be time to get rid of this one, and for the time being just keep the option but make it an alias of safepower? Another option is the opposite: get rid ofsafepower. It was meant as a temporary solution waiting for the moment we could drop the older scikit-learn versions. IIUC we would need to restrict to sklearn >= 1.7.0 (16½ months old) and scipy>=1.12 (2 years 9 months old), so the newest we would drop would be sklearn 1.6.1 (2025-01-10, about 21½ months old). Our policy is to support up to 3 years old so maybe not yet? :'(exp: now quite easy to overflow. In the best case we get an error (like forlog) that we could make nicer, but in the worse case it seems that a wide range of y just make the z-score collapse the values (with aRuntimeWarning: invalid value encountered in log). Not sure how to best handle this? We could standardize beforeexplike before, though it might not be very intuitive that we do it forexpbut notlog. We could also check the number of unique values before / after the transform but not sure how robust it is. I'm also not sure if this option is really used so wouldn't be opposed to depreciating it 🤔
Collaborator
Author
|
Thanks for the review! I kept our lives easy for this one and:
|
Base automatically changed from
benjamin/res-2639-target-encoder-refactor
to
main
October 28, 2026 13:16
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
from
October 28, 2026 13:16
130de98 to
a57a6ef
Compare
bejaeger
enabled stacked auto-merge
October 28, 2026 13:17
Apply the preset before standardization so log1p receives raw targets. Resolve the none preset to standardization only and pin the ordering, inverse mapping, and finite-input behavior with regression tests.
bejaeger
force-pushed
the
benjamin/res-2639-transform-unnormalized-target
branch
from
October 28, 2026 15:33
a57a6ef to
4232971
Compare
7 of 10 tasks
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.

Generated by Codex
Apply regression target transforms such as
log1pbefore final standardization so they receive targets in their original units. Keep input standardization inside the regressionpowerandsafepowerpresets to preserve its previous behavior when members use the full training set. This fixes the log1p domain problem while retaining the default transform semantics, subject to floating-point differences and member-specific statistics when subsampling.Closes RES-2639. PR 2 of 2; #1198 has merged. This branch now targets main.
Transform order and default behavior
1_plus_log: raw targets → log1p → standardize. Raw targets must still satisfy the log1p domain.powerandsafepower: raw targets → standardize → existing power preset → final standardize. The existing preset already standardizes its output, so the final standardization is mathematically redundant but can introduce rounding differences.Noneand"none": standardize only.The power wrappers apply only to regression targets. Feature preprocessing is unchanged. Without subsampling, the values supplied to safepower match the former global-standardization path. With subsampling, members fit their own target statistics. Inverse transforms return raw units, then borders map back to the shared standardized aggregation space; matching statistics cancel mathematically, but bit-identical predictions are not guaranteed.
Validation and benchmark scope
Earlier review validation: 42 focused tests passed. Nine new cases failed before the changes (four
powercases, four invalid log-domain cases, and the missingexpwarning). Existing safepower input-equality and inverse tests remain green.lognow rejects raw targets <= 0 and1_plus_logrejects raw targets <= -1 during fitting, with actionable errors.expwarns only whenexp(y)would produce infinities in float32, reporting the affected target count. Safe inputs remain quiet. The transform retains raw-target semantics and does not guarantee numerical stability beyond this overflow diagnostic.Earlier validation on main
ffd53715and the updated #1198 passed all 51 selected tests, covering target transforms, safepower, integer-target loss, near-constant frames, custom-loop state isolation, grouped shape safety, and config equivalence. Pre-commit checks pass. See #1198 for the broader base-layer validation and rebase fixes.Earlier TabArena Lite default-only validation compared main
f58bec9aagainst stackf1bdf93fon 13 regression datasets, one split each, using the same default v3.5 checkpoint and eight estimators on RTX Pro 6000 Flex. Reference calibration against 77 TabArena methods, with RF default anchored at 1,000, gave 2,250 Elo for main and 2,264 for the stack. Those results predate the safepower preservation change and do not validate the latest revision. No new accuracy or Elo claim is made for this update.CPU accuracy test failure
The transform accuracy test now sets
inference_precision=torch.float32. Automatic CPU precision selected bfloat16 on the Linux runner, but float32 on macOS. On Linux with PyTorch 2.5.0, NumPy 1.23.5, SciPy 1.11.1, and scikit-learn 1.4.2, the previous and current safepower pipelines produced identical predictions: R² 0.6911 in bfloat16 versus 0.7832 in float32. This reproduces the threshold failure without a change from the target-transform order.The R² > 0.7 assertion and production precision defaults are unchanged. Rebased onto main
d05cd1beafter #1198 merged. All three patched accuracy cases pass on Linux with the minimum numerical dependencies. All 19 focused local tests and pre-commit checks pass; full CI is running.