Skip to content

check_estimator for estimators which require a mandatory extra fit param. #16756

Open

Description

@adrinjalali

Right now the check_estimators will fail if the given estimator requires a parameter to fit other than X, y. fairlearn/fairlearn#342 is an example of where it fails.

In some use-cases, it makes sense to require an extra parameter. For instance, in the case of fairness, you may require the sensitive_features to be passed as well as the data itself. How should we handle these cases?

An alternative would be to have feature names during fit and set the sensitive feature names in __init__.

@thomasjpfan would you have an idea?

Activity

  1. rth commented on Mar 25, 2020

    @rth
    Member

    Maybe we can introduce _required_fit_parameters by analogy with _required_parameters for __init__?

    Though generally it would likely mean that we would just skip all tests for estimators that require fit parameters, since it's hard to know what should be passed there in common tests.

  2. amueller commented on Mar 30, 2020

    @amueller
    Member

    So in effect it would be the same as "_skip" right? Unless we provide a mechanism to create a valid column for arbitrary data ;)

  3. adrinjalali commented on Mar 31, 2020

    @adrinjalali
    MemberAuthor

    In our monthly call we talked about this, and it seems we're okay with having a mechanism in the estimator checks, for the test suite to provide a data generator. This would have the benefit of keeping the estimators clean from test specific code, and yet allow third party developers to further tune the estimator checks. Afterall, one primary goal of estimator checks is to make sure they can be used in a pipeline and/or a grid search, and we know right now estimators can fail in the tests and yet be compatible with our pipeline/GS/etc.

  4. added
    Developer API
    on Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Developer APIRFCmodule:utils

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions