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

PermutationImportance uses CV splitter indexes incorrectly #411

Open
zeromh opened this issue Sep 17, 2021 · 0 comments
Open

PermutationImportance uses CV splitter indexes incorrectly #411

zeromh opened this issue Sep 17, 2021 · 0 comments

Comments

@zeromh
Copy link

zeromh commented Sep 17, 2021

The error is in PermutationImportance.fit when using cv=KFold or some other sklearn splitter.

sklearn splitters return the location indexes (i.e. iloc) of the rows, whereas PermutationImportance.fit is treating these as label indexes (i.e. loc).

This only gives the correct result when the index labels are the same as the index locations (e.g. when you have the default RangeIndex). If the dataframe has any other index, this will use the wrong splits or create a KeyError.

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

No branches or pull requests

1 participant