Skip to content

ENH All sklearn estimators in trusted list#237

Merged
adrinjalali merged 9 commits intoskops-dev:mainfrom
EdAbati:all-estimators-in-trusted-list
Dec 12, 2022
Merged

ENH All sklearn estimators in trusted list#237
adrinjalali merged 9 commits intoskops-dev:mainfrom
EdAbati:all-estimators-in-trusted-list

Conversation

@EdAbati
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread skops/io/tests/test_audit.py Outdated
@BenjaminBossan
Copy link
Copy Markdown
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.

Comment thread skops/io/tests/test_persist.py
Comment thread skops/io/tests/test_persist.py Outdated
Copy link
Copy Markdown
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.

Comment thread skops/io/tests/test_persist.py Outdated
@EdAbati
Copy link
Copy Markdown
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
Copy Markdown
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?

Comment thread skops/io/tests/test_persist.py
@EdAbati
Copy link
Copy Markdown
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