-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update of "Gracefully accept 'n_jobs', a common sklearn parameter, in NearestNeighbors Estimator" #4267
Update of "Gracefully accept 'n_jobs', a common sklearn parameter, in NearestNeighbors Estimator" #4267
Conversation
…meters; thank you, Dante!
Thank you, wphicks! Co-authored-by: William Hicks <wphicks@users.noreply.github.com>
rerun tests |
Minor style issue; should be easy to take care of |
Codecov Report
@@ Coverage Diff @@
## branch-21.12 #4267 +/- ##
================================================
- Coverage 86.06% 86.03% -0.04%
================================================
Files 231 231
Lines 18691 18751 +60
================================================
+ Hits 16087 16132 +45
- Misses 2604 2619 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@gpucibot merge |
… NearestNeighbors Estimator" (rapidsai#4267) This pull request partially solves [[FEA] rapidsai#3461](rapidsai#3461) This quick-fix has been created to enable cuML's NearestNeighbor estimator to gracefully accept sklearns 'n_jobs' parameter as a pass-through. The purpose of making this quick fix is to allow Imbalanced-Learn samplers to rely on cuML's NearestNeighbor estimator, without producing an error when setting the estimators n_jobs parameter .set_params(**{"n_jobs": self.n_jobs}) The[ original PR ](rapidsai#4178 address this issue was not sufficient, as [`set_params()`](https://github.com/rapidsai/cuml/blob/2fee231ac28d982f64c4a746c25be19750812e81/python/cuml/common/base.pyx#L248) will still raise a ValueError if "n_jobs" is not returned by [`get_param_names()`](https://github.com/rapidsai/cuml/blob/2fee231ac28d982f64c4a746c25be19750812e81/python/cuml/neighbors/nearest_neighbors.pyx#L453) Authors: - https://github.com/NV-jpt - Dante Gama Dessavre (https://github.com/dantegd) Approvers: - William Hicks (https://github.com/wphicks) URL: rapidsai#4267
This pull request partially solves [FEA] #3461
This quick-fix has been created to enable cuML's NearestNeighbor estimator to gracefully accept sklearns 'n_jobs' parameter as a pass-through.
The purpose of making this quick fix is to allow Imbalanced-Learn samplers to rely on cuML's NearestNeighbor estimator, without producing an error when setting the estimators n_jobs parameter .set_params(**{"n_jobs": self.n_jobs})
The original PR to address this issue was not sufficient, as
set_params()
will still raise a ValueError if "n_jobs" is not returned byget_param_names()