-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Parameters validation for sklearn.tree.export_graphviz #26034
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 Parameters validation for sklearn.tree.export_graphviz #26034
Conversation
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.
We should remove the code that checks for the precision
parameter (l.445 - l.457):
# validate
if isinstance(precision, Integral):
if precision < 0:
raise ValueError(
"'precision' should be greater or equal to 0."
" Got {} instead.".format(precision)
)
else:
raise ValueError(
"'precision' should be an integer. Got {} instead.".format(
type(precision)
)
)
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.
Thanks for the PR @Charlie-XIAO. Here are some comments
…e-XIAO/scikit-learn into param-val-export_graphviz
Hi @jeremiedbb, I have made the changes you suggested. Would you mind taking a look? |
A few questions here:
|
probably better to actually accept array-like.
sounds good. |
|
Will update validation of |
#26289 has been merged so I think this PR is ready for review again. Can maintainers take a look? @glemaitre @adrinjalali @jeremiedbb Thank you very much. |
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.
LGTM
…learn#26034) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
Towards #24862.
What does this implement/fix? Explain your changes.
Automatic parameter validation for sklearn.tree.export_graphviz