Recommended way to handle "one parameter greater than the other" with _validate_params()? #28740
j-adamczyk
started this conversation in
General
Replies: 1 comment 1 reply
-
Nop it cannot.
A couple of things that might answer to your question:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am writing a package compatible with Scikit-learn. I want to use the
_validate_params
() approach: #23462. Setting constraints for individual attributes is simple, and it works.But I have
min_distance
andmax_distance
parameters, and requiremin_distance <= max_distance
. Can this be achieved with_parameter_constraints
dict? And if not, how should I approach this? I don't want to repeat validation code in.fit()
and.transform()
, but my transformer does not need any fitting (I have empty.fit()
method).I was thinking about overriding the
_validate_params()
in inheriting class and making the validation there. Will this suffice? Is this the good approach, or should I do something else?Beta Was this translation helpful? Give feedback.
All reactions