[DOC] Add usage examples to core function docstrings (Fixes #1538)#1689
[DOC] Add usage examples to core function docstrings (Fixes #1538)#1689Abhishek9639 wants to merge 5 commits intoopenml:mainfrom
Conversation
66b3fc9 to
7126344
Compare
geetu040
left a comment
There was a problem hiding this comment.
Please fix the code quality checks, here is the guide
http://openml.github.io/openml-python/latest/developer_setup/#4-configure-quality-gates
c93d964 to
2e455d1
Compare
geetu040
left a comment
There was a problem hiding this comment.
Really nice. Left comment for one example, otherwise looks all good and it covers all the mentioned functions in the issue.
| >>> from sklearn.tree import DecisionTreeClassifier # doctest: +SKIP | ||
| >>> clf = DecisionTreeClassifier() # doctest: +SKIP | ||
| >>> task = openml.tasks.get_task(1) # doctest: +SKIP | ||
| >>> run = openml.runs.run_model_on_task(clf, task) # doctest: +SKIP |
There was a problem hiding this comment.
this currently raises the following error, can you look into it?
ValueError: could not convert string to float: '?'
There was a problem hiding this comment.
I would say a better example would be to use a task with a more suitable dataset, may be openml.tasks.get_task(6) and keep using DecisionTreeClassifier, since it's more common as an example
There was a problem hiding this comment.
Thanks for the suggestion.
That makes sense using openml.tasks.get_task(6) with DecisionTreeClassifier will make the example clearer and more standard.
I’ll update the example accordingly and push the changes shortly.
Thanks
.DS_Store
Outdated
- Use HistGradientBoostingClassifier instead of DecisionTreeClassifier (fixes ValueError with missing values in task 1) - Remove .DS_Store - Remove tests/files/misc/features_with_whitespaces.xml.pkl
5a8956d to
c155709
Compare
|
@geetu040, |
|
@geetu040, |

[DOC] Add usage examples to core function docstrings. Closes #1538
Metadata
Details
This PR adds usage examples to selected public core functions in the project
to improve developer experience and documentation clarity.
The following functions were updated with example usage sections:
Why this change is necessary:
Examples in docstrings help users understand how to use the functions directly
from IDE hover tooltips and improve auto-generated documentation.
Reproduction:
No bug reproduction is required. This is a documentation enhancement.
Additional Notes:
Only docstrings were modified. No functional code changes were made.