Repository navigation
Support sequential domain reduction with mixed parameters - #633
bingdongni wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #633 +/- ##
=======================================
Coverage 98.27% 98.28%
=======================================
Files 10 10
Lines 1220 1221 +1
=======================================
+ Hits 1199 1200 +1
Misses 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
t-muser
left a comment
There was a problem hiding this comment.
One minor comment, see below.
The test failure seems to have been some rather unlucky timing with a package's faulty release. If I understand correctly they should not fail again.
| error_msg = "Length of minimum_window must be the same as the number of parameters" | ||
| if isinstance(self.minimum_window_value, Mapping): | ||
| self.minimum_window = [self.minimum_window_value[key] for key in self._float_keys] | ||
| elif isinstance(self.minimum_window_value, (Sequence, np.ndarray)): |
There was a problem hiding this comment.
I think it'd be better if, in the future, we disallow Sequences here and only work with Mappings to make sure that we (and by "we" I mean a user) don't silently match the wrong minimal windows to parameters. For this purpose, could you trigger a deprecation warning here, mentioning that in a future release minimum window needs to be a mapping with keys matching the parameters?
Closes #620.
A tuning problem can now use sequential domain reduction on a float parameter alongside integer and categorical choices. The transformer updates just the float bounds. It reads the incumbent by parameter name, so a categorical parameter with several encoded columns can precede the float. A minimum window can be specified for the float parameters alone. All-discrete spaces still raise at initialization.
On loading a checkpoint, the optimizer uses each parameter's encoded mask to restore changed bounds. This keeps the discrete parameter types intact. The regression exercises optimization and a save/load round trip with scalar, sequence and keyed minimum windows.
Linux validation passed all 193 tests, including the example notebooks. As an end-to-end check, a random forest was tuned over a continuous sampling fraction, integer depth and categorical split criterion on scikit-learn's breast cancer dataset. The fraction range narrowed from [0.2, 1.0] to [0.2, 0.450], the discrete domains were preserved, and all seven recorded AUCs reproduced on re-evaluation.
Codex assisted with the implementation and tests.
The Nov 25 upstream test run stopped during dependency installation:
fonttools 4.69.0had no wheel for the affected Python versions. In a fresh Linux run, the original base resolvedfonttools 4.69.1. The patch passed all 193 tests on Python 3.12 with both NumPy 1.26.4 and 2.5.5.Summary by CodeRabbit