-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Add option gamma='scale' and 'auto' to RBFSampler #24748
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
Comments
This should not be the case in scikit-learn/sklearn/kernel_approximation.py Lines 321 to 325 in 55b55af
Regarding the proposal of adding the |
If Needs Triage tag is removed, it's free to draft a PR? |
Yep. We would still need to have another reviewer to review the PR but otherwise it should be fine. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the workflow you want to enable
Right now SVM supports gamma parameter to be set to 'scale' or 'auto', which will automatically determine gamma parameter based on data, but RBFSampler does not support this.
On top of that there is no check on n_components parameter, which allow users to set it to 0 and fit it without errors. It will only raise error if n_components is negative -
ValueError: negative dimensions are not allowed
(this is numpy error from random.normal generation, not sklearn one).Describe your proposed solution
Add 'scale' and 'auto' option to RBFSampler
Describe alternatives you've considered, if relevant
It is possible to calculate gamma beforehand on your own, but it become increasingly tiresome if for example someone is performing CV - you will have to use custom loop instead of
cross_val_score
and others.Additional context
No response
The text was updated successfully, but these errors were encountered: