added list_estimation_procedure in init files and returns a dict[int,…#1721
Open
Manas-7854 wants to merge 2 commits intoopenml:mainfrom
Open
added list_estimation_procedure in init files and returns a dict[int,…#1721Manas-7854 wants to merge 2 commits intoopenml:mainfrom
Manas-7854 wants to merge 2 commits intoopenml:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR exposes list_estimation_procedures via openml.evaluations and the top-level openml package, and changes the function to return an id -> name mapping to help users discover valid estimation_procedure_id values (related to #1249).
Changes:
- Change
openml.evaluations.list_estimation_procedures()to returndict[int, str](id-to-name mapping) instead of a list of names. - Re-export
list_estimation_proceduresfromopenml/evaluations/__init__.pyandopenml/__init__.pyfor easier access. - Add integration tests asserting return type and top-level accessibility.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
openml/evaluations/functions.py |
Changes list_estimation_procedures return type to dict[int,str] and updates docstring accordingly. |
openml/evaluations/__init__.py |
Re-exports list_estimation_procedures from the evaluations package. |
openml/__init__.py |
Re-exports list_estimation_procedures at the top-level openml namespace and adds it to __all__. |
tests/test_evaluations/test_evaluation_functions.py |
Adds tests for the new return type and top-level access. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
openml/evaluations/functions.py
Outdated
Comment on lines
+301
to
+309
| def list_estimation_procedures() -> dict[int, str]: | ||
| """Return dictionary of evaluation procedures available. | ||
|
|
||
| The function performs an API call to retrieve the entire list of | ||
| evaluation procedures' names that are available. | ||
| evaluation procedures' ids and names that are available. | ||
|
|
||
| Returns | ||
| ------- | ||
| list | ||
| dict[int, str] |
openml/evaluations/functions.py
Outdated
Comment on lines
302
to
306
| """Return dictionary of evaluation procedures available. | ||
|
|
||
| The function performs an API call to retrieve the entire list of | ||
| evaluation procedures' names that are available. | ||
| evaluation procedures' ids and names that are available. | ||
|
|
Comment on lines
+285
to
+289
| def test_list_estimation_procedures_valid_id_for_task_creation(self): | ||
| procedures = openml.evaluations.list_estimation_procedures() | ||
| first_id = list(procedures.keys())[0] | ||
| assert isinstance(first_id, int) | ||
| assert first_id > 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #1249
openml/evaluations/list_estimation_procedurestoevaluations/init.pyandopenml/init.pyto make it accessable