-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Is there any reason for SelectFromModel.transform to use force_all_finite=True in check_array? #10985
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
Comments
This sounds reasonable to me for However I'm not sure if it's worth it; let's wait for a second opinion on this.. |
I'd be happy if this constraint were removed, even in RFE, where the
downstream model will check for finiteness too, and perhaps univariate
(although then finiteness checks should be implemented in our available
score functions)
|
I am happy to work on this issue if there is no one else working on it. |
I have made an example how it could be fixed. Could you please review it? |
I've just created a new PR that works to address this and #10821 and would love some feedback on it. It seems like the feature selection classes should generally leave as much validation as possible to their estimators, since they need to be handling all of that already and right now they create unnecessary/artificial constraints. However allowing NaN/Inf in I was also wondering if people have ideas for what tests to write for this. I wrote some that simply test that NaN/Inf are allowed in the input and no errors are raised, which covers both the |
Description
SelectFromModel's transform raises ValueError if any value is infinite or NaN - however the values aren't actually used anywhere, so it seems to me that this check (check_array using default True value for parameter force_all_finite) could be lifted. as some models are capable of working with such values (e.g. tree based models should handle infinities properly). This could also apply to some other feature selection methods.
The text was updated successfully, but these errors were encountered: