Skip to content
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

ENH All sklearn estimators in trusted list #237

Merged
merged 9 commits into from Dec 12, 2022

Conversation

EdAbati
Copy link
Contributor

@EdAbati EdAbati commented Dec 4, 2022

Fixes #223

Hi all, I have added all sklearn estimators to the trusted list of ObjectNode and added test for it.

A couple of things that I am not 100% sure about:

  • the issue mentioned to add some 'sanity checks' when getting the list of estimators. For now I am checking that the module name starts with 'sklearn.', should I add any extra ones?
  • is ObjectNode the only place where we should add the sklearn estimators in the trusted list? What about TypeNode?
  • I have extracted get_tested_estimators in a common place (testing_utils.py) so I could reuse it. I could not use the name common.py because there is already a common.py in hub_utils and pytest complained. Should we maybe have a common utils file for all the tests?

Copy link
Member

@adrinjalali adrinjalali left a 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 @EdAbati , this looks great.

skops/io/tests/test_audit.py Outdated Show resolved Hide resolved
@BenjaminBossan
Copy link
Collaborator

BenjaminBossan commented Dec 5, 2022

@adrinjalali You are most qualified to review this, would you take it?

  • I have extracted get_tested_estimators in a common place (testing_utils.py) so I could reuse it. I could not use the name common.py because there is already a common.py in hub_utils and pytest complained. Should we maybe have a common utils file for all the tests?

I don't think we need a "common" common.py, since the different sub-modules deal with quite different objectives. Regarding the name, I feel like testing_ is a bit redundant, since we're already in the tests directory, so how about just _utils.py?

EDIT: Wrote this before seeing Adrin's reply.

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

It's definitely worth having a way to get other types which are not trusted by this PR, but I don't think we should have that list in the codebase.

skops/io/tests/test_persist.py Outdated Show resolved Hide resolved
@EdAbati
Copy link
Contributor Author

EdAbati commented Dec 7, 2022

Hi @adrinjalali , I tweaked the unittest it looks nicer now, thanks :)

Regarding instead:

It's definitely worth having a way to get other types which are not trusted

do you have anything in mind?

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

This LGTM. Thanks @EdAbati . Could you please also add an entry in our changelog?

skops/io/tests/test_persist.py Show resolved Hide resolved
@EdAbati
Copy link
Contributor Author

EdAbati commented Dec 11, 2022

Thank you @adrinjalali for the help! :)
I have updated the changelog.

@adrinjalali adrinjalali changed the title All estimators in trusted list ENH All sklearn estimators in trusted list Dec 12, 2022
@adrinjalali adrinjalali merged commit 7a9c126 into skops-dev:main Dec 12, 2022
@EdAbati EdAbati deleted the all-estimators-in-trusted-list branch December 12, 2022 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add all scikit-learn estimators to the default trusted list
3 participants