-
-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
DOC DataConversionWarning: Add example to doc of DataCon… #16704
DOC DataConversionWarning: Add example to doc of DataCon… #16704
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.
@danielbarkhorn I see this is your first time contributing, welcome!
sklearn/exceptions.py
Outdated
>>> with warnings.catch_warnings(record=True) as w: | ||
... try: | ||
... # Will trigger warning as metric requires X.dtype=bool | ||
... D = pairwise_distances(X, metric="jaccard") |
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.
May we use column_or_1d
instead as an example that issues a DataConversionWarning
warning? I think users would run into that situation more often.
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
Thanks @toondeboer |
Reference Issues/PRs
One of the TODO's in #3846, the
DataConversionWarning
class needed an example in the doc. Therefore I took inspiration from the example in theFitFailedWarning
class doc.What does this implement/fix? Explain your changes.
Adds an example to the class description where the warning is triggered.
Any other comments?
This is my first PR to scikit-learn so I'm happy to hear if any changes are necessary!