Repository navigation
feat: HistGradientBoosting defaults to the native preprocessor - #73
Merged
Merged
Conversation
Previously HGB shared the default impute+scale+encode preprocessor like every other estimator, discarding the missingness and categorical structure it can handle natively. Now any HGB estimator without an explicit preprocessor_map entry automatically uses the "native" profile. - _effective_preprocessor_map() adds HGB→native defaults (user entries win), so preprocessor_map shows only the non-default mappings - The auto-default is skipped when a custom (non-PoniardPreprocessor) preprocessor is supplied: the user has taken over preprocessing, so every estimator uses their template unless explicitly mapped - _build_preprocessors now computes feature_types when the default is a custom pipeline, fixing a latent KeyError when building "native" on demand with a custom preprocessor - guide + example updated; new tests for the auto-default, explicit override, and custom-preprocessor skip Closes #73-style follow-up: HGB no longer shares the rest's preprocessor by default. All 281 tests pass; coverage 90.1%.
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
HGB previously shared the default impute+scale+encode preprocessor with every other estimator, discarding the missingness and categorical structure it can handle natively. Now any
HistGradientBoosting*estimator without an explicitpreprocessor_mapentry automatically uses the"native"profile.Changes
_effective_preprocessor_map(): user-supplied entries win; HGB estimators default to"native".preprocessor_mapstill only shows non-default entries, so a plainPoniardRegressor()now reports{"HistGradientBoostingRegressor": "native"}.PoniardPreprocessor) preprocessor is supplied — the user has taken over preprocessing, so every estimator uses their template unless explicitly mapped._build_preprocessorsnow computesfeature_typeswhen the default is a custom pipeline, fixing a latentKeyErrorwhen building"native"on demand with a custom preprocessor.03_preprocessing.pyupdated; README row tweaked.Behavior
preprocessor_map={"HistGradientBoostingClassifier": "default"}.Tests (4 new, 1 updated)
Auto-default for HGB (and
from_dtypeside effect), explicit override todefault, custom-preprocessor skips auto-mapping, and on-demandnativewith a custom preprocessor.All 281 tests pass; coverage 90.1% (gate 85%); ruff + format clean. Intended for the 0.7.1 release.