-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
[RFC] Dissociate NaN and Inf when considering force_all_finite in check_array #10455
Copy link
Copy link
Closed
Closed
Copy link
Description
Due to changes proposed in #10404, it seems that check_array as currently a main limitation. force_all_finite will force both NaN and infto be rejected. If preprocessing methods (whenever this is possible) should let pass NaN, this argument is not enough permissive.
Before to implement anything, I think it could be good to have some feedback on the way to go. I see the following solutions:
force_all_finitecould still accept a bool to preserve the behaviour. Additionally, it could accept anstrto filter onlyinf.- [MRG] ENH Permit NaN while allowing to filter out inf in validation tools. #7892 proposes to have an additional argument
allow_nan. @amueller was worried that it makescheck_arrayto complex. - make a private function
_assert_finite_or_nan(similarly to this proposal removing the numpy version checking) in thedata.pywhich can be shared between the preprocessing methods.
They are the solutions that I have in mind for the moment but anything else is welcomed.
@jnothman @agramfort @amueller @lesteve @ogrisel @GaelVaroquaux I would be grateful for any insight.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels