Skip to content

MAINT use properly the metadata from OpenML - #29411

Closed
glemaitre wants to merge 1 commit into
scikit-learn:mainfrom
glemaitre:improve_metadata_usage_openml
Closed

glemaitre wants to merge 1 commit into
scikit-learn:mainfrom
glemaitre:improve_metadata_usage_openml

Conversation

@glemaitre

Copy link
Copy Markdown
Member

This PR improve the code in _openml.py to use the json file from OpenML. In this case, it helps at transitioning from ARFF file to parquet file. It also makes it easier for transitioning from v1 API to the future v2.

@glemaitre
glemaitre marked this pull request as draft July 4, 2024 08:18
@github-actions

github-actions Bot commented Jul 4, 2024

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 3d78d44. Link to the linter CI: here

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some early feedback. Feel free to ping me when the PR is ready for review.

Comment on lines +126 to +127
OpenML URL that will be accessed. We parse the URL to get the path and
replicate the tree structure on the local cache.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OpenML URL that will be accessed. We parse the URL to get the path and
replicate the tree structure on the local cache.
URL of an OpenML file to be downloaded and cached locally. The path component
of the URL is used to replicate the tree structure as sub-folders of the local
cache folder.

return gzip.GzipFile(fileobj=fsrc, mode="rb")
return fsrc

openml_path = urlparse(url).path[1:] # remove leading slash

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safer and more explicit this way:

Suggested change
openml_path = urlparse(url).path[1:] # remove leading slash
openml_path = urlparse(url).path.lstrip("/") # remove the leading slash

@lesteve

lesteve commented Jan 24, 2025

Copy link
Copy Markdown
Member

Superseded by #30708

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants