Repository navigation
feat: ensemble support for mixed per-estimator preprocessors - #72
Merged
Merged
Conversation
Implements the ML defaults improvements Part 2, step 4. - _make_pipeline gains an include_preprocessor knob (None = resolve from self.preprocess, False = bare) and add_estimators forwards it - build_ensemble: if all selected members map to the same preprocessor, keep current behavior (bare members, ensemble wrapped in that preprocessor, preprocessing runs once); if members are mixed, each member contributes its full pipeline and the ensemble is added bare - _configure_native_estimator exempts ensembles (Voting/Stacking), whose members are already validated, so an all-native ensemble can be wrapped in the native preprocessor Tests: all-default ensemble uses default, all-native ensemble uses native and fits, mixed ensemble (voting + stacking) is bare with full-pipeline members and fits/scores. All 276 tests pass.
- guide: fix the stale datetime pipeline row (median imputer + scaler), note VarianceThreshold is default-profile only, expand the per-estimator preprocessors section (registry API, native validation, reassign_types propagation, ensemble behavior for same vs mixed preprocessors), and mention the preprocessor selector in mutators and ensembles - README: update the preprocessing feature-overview row and list the new preprocessing example - examples: add 03_preprocessing.py covering the default profile, the native HGB profile via preprocessor_map, and runtime template registration/assignment; executed in CI via test_examples
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.
Summary
Part 2, step 4 (final block) of the ML defaults improvements plan (
docs/ml-defaults-improvements.md).Changes
_make_pipelinegains aninclude_preprocessorknob (None= resolve fromself.preprocess,False= bare pipeline);add_estimatorsforwards it.build_ensemblenow inspects the members'preprocessor_map:defaultor allnative): current behavior — bare members, ensemble wrapped in that preprocessor (preprocessing runs once), and the ensemble is mapped to it._configure_native_estimatorexempts ensembles (Voting/Stacking), whose member estimators were already validated, so an all-native ensemble can be wrapped in the native preprocessor.Tests (5 new)
All-default ensemble uses
defaultwith bare members; all-native ensemble usesnativeand fits/scores; mixed ensemble (voting + stacking, parametrized) is bare with full-pipeline members and fits/scores with no NaNs.All 276 tests pass; coverage 89.8% (gate 85%); ruff + format clean.