Skip to content

Add common test to ensure all(predict(X[mask]) == predict(X)[mask]) #10420

Closed

Description

@jnothman

I don't think we currently test that estimator predictions/transformations are invariant whether performed in batch or on subsets of a dataset. For some fitted estimator est, data X and any boolean mask mask of length X.shape[0], we need:

all(est.method(X[mask]) == est.method(X)[mask])

where method is any of {predict, predict_proba, decision_function, score_samples, transform}. Testing that predictions for individual samples match the predictions across the dataset might be sufficient. This should be added to common tests at sklearn/utils/estimator_checks.py

Indeed, #9174 reports that this is broken for one-vs-one classification. :'(

Activity

  1. added
    Moderate
    on Jan 8, 2018
  2. Johayon commented on Jan 8, 2018

    @Johayon
    Contributor

    Hi, could I take this issue ?

  3. jnothman commented on Jan 8, 2018

    @jnothman
    MemberAuthor
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

    BugModeratehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions