-
-
Notifications
You must be signed in to change notification settings - Fork 26k
MAINT Param validation: apply skip nested validation to all functions #26495
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
MAINT Param validation: apply skip nested validation to all functions #26495
Conversation
Should we then make |
That's what I did :) see the new signature: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it'd be feasible for you to put a comment wherever prefer_skip_nested_validation=False
? Cause it's almost always True
@@ -680,7 +681,8 @@ def _set_reach_dist( | |||
"core_distances": [np.ndarray], | |||
"ordering": [np.ndarray], | |||
"eps": [Interval(Real, 0, None, closed="both")], | |||
} | |||
}, | |||
prefer_skip_nested_validation=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this here True
but compute_optics_graph
has it as False
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adrinjalali here's a list of all places where I set it to False with the reason for each.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adrinjalali here's a list of all places where I set it to False with the reason for each.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the ones which are False
and the reason is something other than them being an estimator wrapper, it'd be nice to have the reason commented in the code for future maintainers.
@@ -559,7 +560,8 @@ def _more_tags(self): | |||
{ | |||
"X": ["array-like"], | |||
"axis": [Options(Integral, {0, 1})], | |||
} | |||
}, | |||
prefer_skip_nested_validation=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this false but the other ones in this file True?
@@ -296,6 +296,7 @@ def test_function_param_validation(func_module): | |||
|
|||
PARAM_VALIDATION_CLASS_WRAPPER_LIST = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minmax_scale and similar ones are not?
@@ -305,6 +304,7 @@ def test_function_param_validation(func_module): | |||
("sklearn.decomposition.dict_learning", "sklearn.decomposition.DictionaryLearning"), | |||
("sklearn.decomposition.fastica", "sklearn.decomposition.FastICA"), | |||
("sklearn.decomposition.non_negative_factorization", "sklearn.decomposition.NMF"), | |||
("sklearn.preprocessing.maxabs_scale", "sklearn.preprocessing.MaxAbsScaler"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should robust_scale
also be here?
Thanks @jeremiedbb. |
Follow-up of #25815
This PR sets
prefer_skip_nested_validation
to all validated functions.There are situations where we don't want to skip inner validation (prefer_skip_nested_validation=False):
Functions receiving cv objects can skip inner validation because cv objects are not validated yet. When we decide to validate cv objects we'll need to revisit this.