Repository navigation
Fix silent training and NumPy sampling parameters - #36
Merged
Merged
Conversation
Guard the logging interval when verbose is non-positive while preserving validation metrics and early stopping. Add logging and GPU training regressions. Fixes #33
Recognize real numeric scalars, validate rates in (0, 1], and reject unsupported objects before training. Preserve callable sampler callbacks and document the parameter contract. Add GPU regressions for numeric types, invalid values, custom sampler lifecycles, and simultaneous row/column sampling in GradientBoosting and SketchBoost. Fixes #27
Convert validated real sampling rates to Python float so NumPy 2 does not cast large row or column counts to float16 and overflow. Add boundary checks for both sampling axes and a 100,000-row training regression against a Python-float control.
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.
Fix silent training and NumPy sampling parameters
GradientBoosting.fit()currently raisesZeroDivisionErrorwhenverbose=0, and treats NumPy sampling scalars such ascolsample=np.float64(0.5)as callbacks, producing an unrelatedAttributeError. These failures also affectSketchBoostthrough the shared implementation.This change allows silent training and accepts Python/NumPy real numeric sampling rates consistently. For example,
verbose=0, colsample=np.float32(0.5), subsample=np.float64(0.5)now completes training.Changes
verbose > 0. Validation metrics, history, and early stopping still run when logging is disabled; positive logging intervals keep their existing behavior.numbers.Realinstead of exact Python type comparisons. Accept rates in(0, 1]; reject invalid ranges, NaN/infinities, booleans, arrays, and unsupported objects with parameter-specific errors before training.floatbefore constructingBaseSampler, preventing NumPy 2 from casting large axis lengths tofloat16and overflowing.Callback.GradientBoostingandSketchBoostparameter documentation and add regression coverage.Validation
verbose=0with/without evaluation sets.OverflowErrorbefore normalization and pass afterward.git diff --checkpasses. Other Python versions and operating systems were not executed.scatter_adddeprecation warnings.Command:
Fixes #33
Fixes #27